Sunday, May 17, 2009

Install and Configure PHP

Start by creating a directory into which you will extract the downloaded PHP files (php-5.1.4-Win32.zip). In this example I’m going to use C:\PHP as my installation directory.

Then extract the files from php-5.1.4-Win32.zip into C:\PHP
If you need to use the additional PECL modules then extract the files from ‘pecl-5.1.4-Win32.zip’ into the C:\PHP\ext directory.






Next locate the file ‘php.ini-recommended’ in C:\PHP and rename it to ‘php.ini’ (without the quotes of course



Open the ‘php.ini’ file and find the line which reads extension_dir = “./” and change it to extension_dir = “C:\PHP\ext”. This tells PHP where the various extensions are located and as you can see the default path in the ‘php.ini-recommended’ file which ships with PHP points to the wrong location, so you need to change it.


You also need to add the location of your PHP directory to the server’s PATH environment variable so that Windows knows where to look for any PHP related executables (such as the PHP extension DLL‘s).


To do this Right-click on My Computer, click Properties and on the Advanced tab click Environment Variables. In the Environment Variables dialog box, under System variables highlight the Path variable and clickEdit.

Add ‘ ;C:\PHP ’ (be sure to include the semi-colon separator) as shown here and click OK.





















No comments:

Post a Comment