Steps to Setting Up PHP 5
1.Download PHP 5
Before you begin, get a copy of PHP 5 fromthe PHP download page. In particular, download thezip package from the "Windows Binaries" section - that is, don't get the installer. For example,select the package labelled "PHP 5.2.5 zip package" if 5.2.5 is the current version.
2.Install PHP 5
Create a folder on your hard disk for PHP. I suggest "c:\php" although you can use other names if you wish. Personally though, I prefer to avoid names with spaces in it, like "c:\Program Files\php"to avoid potential problems with programs that cannot handle such things. I will assume that youused c:\php in this tutorial.Extract all the files from the zip package into that folder. To do that simply double-click the zipfile to open it, and drag all the files and folders to c:\php.
3.Upgraders: Remove the Old PHP.INI File from Your Windows Directory
If you are upgrading to PHP 5 from an older version, go to your windows directory, typicallyc:\windows, and delete any php.ini file that you have previously placed there.
4.Configuring PHP
Go to the c:\php folder and make a copy of the file "php.ini-recommended". Name the new file"php.ini". That is, you should now have a file "c:\php\php.ini", identical in contents with"c:\php\php.ini-recommended". Note: if you are using Apache 1, you should either move the php.ini file to your windowsdirectory, "C:\Windows" on most systems, or configure your PATH environment variable toinclude "c:\php". If you don't know how to do the latter, just move the php.ini file to the"c:\windows" folder. You do not have to do this if you are using Apache 2, since we will include adirective later in the Apache 2 configuration file to specify the location of the php.ini file.Use an ASCII text editor (such as Notepad, which can be found in the Accessories folder of your Start menu) to open "php.ini". You may need to make the following changes to the file, dependingon your requirements:
1.Enable Short Open Tags
Search for the line that reads:short_open_tag = Off If short_open_tag is set to "off", tags like "<?" will not be recognised as the start tag for aPHP script. In such a case, to begin a PHP script, you will need to code your script withan opening tag like "<?php". Since many third party PHP scripts use "<?", setting this to"Off" will give you more problems than it's worth, particularly since most, if not all,commercial web hosts that support PHP have no issues with your scripts using "<?" asthe open tag. To fix this, change it to the following:
Leave a Comment