Powered By Blogger

Friday, 29 July 2011

Installing PHP On Windows

There are several different installation methods for PHP, though we strongly recommend you follow the manual installation process. At the time of publication, the automated installer is not complete, secure or intended for use on live servers. Follow these steps to install PHP on your system:

1. Go to the PHP web site at www.php.net .

2. Click on the Download link to go to the site ’ s downloads page.

3. Scroll down to the Windows Binary section, and click on the appropriate link to download the
latest PHP .zip package.

4. Click any of the mirror sites to begin the download. If you have difficulties downloading from
one mirror, then try a different mirror that may be closer to you.

5. Once the Zip file has been downloaded, extract its contents using any standard unzip program
and save it to the directory of your choice. We recommend a directory named C:\PHP .
Both Windows XP and Windows Vista have built - in capabilities to extract files from Zip
archives. If you are on a different version of Windows or prefer to use a dedicated compression
tool, we recommend 7 - Zip available at www.7 - zip.org . It is a free application that can work
with many different compression formats, including Zip.

6. It is advised to run PHP with a php.ini file. By default, the PHP installation provides
two copies of the file with common configuration values: php.ini - dist and
php.ini - recommended . Rename the configuration file of your choice to php.ini .
The php.ini - dist file is meant to be used for development purposes while
php.ini - recommended has additional security measures and should be used when your site
goes live. Depending on your reason for using PHP, choose the php.ini file that best suits your
needs. For the purposes of this book, we are going to be using the php.ini - dist . Feel free to
switch to the php.ini - recommended file as your default once you are more familiar with how
PHP behaves.

7. Bring up the System Properties window. In Windows XP, this is done by right - clicking on the
My Computer icon on your desktop and selecting Properties. In Windows Vista, this is done by
right - clicking on the Computer icon on your desktop, selecting Properties and then Advanced
System Settings.

8.Select the Advanced tab, and then click the Environment Variables button. Add the directory to
which you extracted PHP to your System ’ s PATH variable ( C:\PHP in our configuration). Also
create a new System variable PHPRC with the same directory as its value. This allows other
applications (such as Apache) to find PHP without your having to copy files into your System
directory.

No comments:

Post a Comment