Thursday , 21 September 2017

How to Install PHP on Windows-Full Guide

Why PHP?
PHP is the most common and popular programming language on the web server side. It is installed by most web hosts, has a simple learning curve, and close relationships with the MySQL database, and an excellent set of libraries to reduce development time. PHP can not be perfect, but it certainly should be considered in your web application your next. Yahoo and Facebook and use it with great success.

Why install PHP locally?

PHP is installed on your development computer allows you to create a safe and testing of Web applications without affecting the data or systems to direct the site for you. This article describes the installation of PHP module in the Windows version of Apache 2.2. Perhaps already installed Linux and Mac users.
All-in-one packages

There are some excellent all-in-one Windows distributions containing Apache, PHP and MySQL and other applications in a single installation file, for example XAMPP (including Mac version), and Web.Developer WampServer. There is nothing wrong with these packages, although the installation of Apache and PHP guide will help you learn more about the system and its configuration options.

Install PHP

Although the installation is available on, I would recommend the manual installation if you already have a web server configured and running.

Installation Guide

Installation Guide offers several advantages:

Backup, reinstall, or transfer can be done in seconds the web server (see 8 Tips to stay failure PC) and
You have more control over PHP and Apache configuration.

Step 1: Download files

Download the latest PHP 5 postal packet of

As always, the virus file and check the MD5 checksum using a tool such FSUM.
Step 2: Extract the files

We will install PHP files in C: PHP to create this file and extract the contents of the compressed file.

PHP can be installed anywhere on your system, but you must change the paths referred to in the following steps.
Step 3: Configure php.ini file

Version C: phpphp.ini- recommended C: phpphp.ini. There are several lines, you will need to change in a text editor (use the search to find the current setting).

Determine the extension directory:

extension_dir = “C: phpext”

Enable Extensions. This depends on the libraries you want to use, but you must have the following accessories suitable for most applications (remove the comment semicolon)

Extension = php_curl.dll
Extension = php_gd2.dll
Extension = php_mbstring.dll
Extension = php_mysql.dll
Extension = php_mysqli.dll
Extension = php_pdo.dll
Extension = php_pdo_mysql.dll
Extension = php_xmlrpc.dll

If you want to send e-mail messages using PHP mail () function, go into the details of the SMTP server (server of the ISP must adapt):

[Mail function] . For Win32 only.
smtp_port = 25

. For Win32 only.
sendmail_from =

Step 4: Add C: PHP environment variable to the path

To ensure that Windows can find PHP, must change the environment variable path. In the Control Panel, click System, (then “Advanced System Settings” in Vista), select “Advancedtab, then click the Environment Variables” button.

Scroll through the list of system variables and click on the path” and click the “Change” button. Enter “C: PHPat the end of the line value of the variable (remember the semicolon).

PHP environment variable path

OK your way now. You may need to restart at this point.
Step 5: Configure PHP as an Apache module

Make sure Apache is not running (the use of net stop Apache2.2″ command line) and open the configuration file in confhttpd.conf editor. The following lines must be modified:

Line 239, as well as the name of the default index.php file:

DirectoryIndex index.php index.html and

At the end of the file, add the following lines (edit PHP files sites if necessary):

Unit # PHP5
LoadModule php5_module “c: /php/php5apache2_2.dll”
AddType application / x- httpdphp PHP
PHPIniDir “C: / PHP”

Save the configuration file and test it from the command line (Start> Run> cmd):

CD Apache2bin
Httpd -t

Step 6: Test PHP file

Create a file called index.php in the web page of the root Apache (htdocs, D, or Web pages) and add this code:

PHP phpinfo <(?);?>

Making Apache started successfully, open a Web browser and type http: // localhost /. If all goes well, a “PHP” page should appear showing all the configuration settings.

See also:

How to install Apache
How to install cell
Cell: the pros and cons of MySQL tables
Cell: the advantages and disadvantages of the tables as InnoDB
How to use MySQL foreign keys for faster development database

Good luck!

If you enjoyed reading this article, you’ll love programming. The right place to gain new skills and techniques of the masters. Members get instant access to all the books  TIPSUSTAAD and interactive online courses like PHP & MySQL Web Development for beginners.

Comments are closed for this article. Have a question about PHP? Why do not you ask the forums?
Craig gear

Craig is a freelance adviser to the British Internet who built the first page has IE2.0 in 1995‘s and since that time he has been to strengthen the standards, ease of access, and best technical practices for HTML5. Nearly 1,000 articles have been written and you can find TIPSUSTAAD himcraigbuckler

You may also like:

How Microsoft Word documents with PHP

Ryan Taylor

August 2, 2014
Of course: PHP & MySQL Web Development for beginners databases

Kevin Yank

Assist in the development of PHP: 5.6 RC1 Homestead

Bruno Skvorc

Jan  6, 2015

Free book: jump start the basics of HTML5

Take a free copy of one of the latest books we have! Packed with tips and tricks on the powerful new features of HTML5.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *