Installation of PHP + Apache
In this post i am going to describe the procedure of installation of PHP and Apache on your own computer.
Step-1 Download PHP , I am using “php-5.2.5-Win32.zip”
Step-2 Download Apache, I am using “httpd-2.0.64-win32-x86-no_ssl.msi”
Step-3 Once you download , first install Apache server
write localhost in the first two fields and put any email id in the last field.
If you want Apache to automatically start with the operating system, which is recommended, then
choose to install Apache as a service for all users. When you’re finished, click Next.
You are prompted for a Setup Type: Typical or Custom. choose Typical and click Next
Destination folder. By default, this is C:\Program Files\Apache Group. Consider changing this
to C:\,which will create an installation directory C:\Apache2\. Now click install to complete the installation
Step-4 Unzip the PHP package, placing the contents into C:\php5\.
Step-5 Now add PHP installation directory path to the Windows Path.
for this click start > settings > control panel > system > click on advanced tab click the
Environment Variables button. In the Environment Variables dialog box, scroll through
the System variables pane until you find Path. Double-click this line and, in the Edit
System Variable dialog box, append C:\php5 to the path.
Step-6 Navigate to C:\apache2\conf and open httpd.conf for editing.
Step-7 Add the following three lines to the httpd.conf file. Consider adding them directly
below the block of LoadModule entries located in the bottom of the Global Environment section.
LoadModule php5_module c:/php5/php5apache2.dll AddType application/x-httpd-php .php PHPIniDir "C:\php5"
Step-8 Rename the php.ini-dist file php.ini and save it to the C:\php5 directory.
step-9 navigate to Start > Settings > Control Panel > Administrative Tools > Services.
Locate Apache in the list, and make sure that it is started. if already started then click on restart.
Testing Your Installation
The best way to verify your PHP installation is by attempting to execute a PHP script. Open a
text editor and add the following lines to a new file. Then save that file within Apache’s htdocs
directory as phpinfo.php:
Now open a browser and access this file by typing the appropriate URL:
now you can start coding in php .ENJOY!