Home |
Previous | Next How
to Install PHP 5.x on Windows XP Pro
Once you download the PHP Windows Binaries Zip Package (For Windows XP Pro, I used the Win32-VC9-x86 non thread safe version of the zip file.), unzip it to c:\php. (If you had an older version of php installed rename that directory to c:\php-old then create a new c:\php to unzip the files to.
The newer versions of PHP do not include php5isapi.dll. They use the FastCGI php. I have only tried installing and testing this using IIS 5.1 on XP Pro.
- First you will need to have the FastCGI for IIS extension installed. You can download it from http://www.iis.net/expand/FastCGI. I chose to download and install the x86 version for FastCGI 1.5 for IIS 6 even though my version of IIS is 5.1. Once you start the install it will say that it is also for 5.1.
- I followed the instructions for "Manually Configuring FastCGI Extension to Work with PHP" in this document, http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/ to configure my system to use FastCGI.
- Note: To launch inetmgr.exe, you can either
- go to Start > Rung and type inetmgr.exe in the Open field and press OK or
- go to Start -> Control Panel -> (Performance and Maintenance) ->Administrative Tools -> Internet Information Services
- The newer version of php does not have an initial php.ini although it does have a development and production .ini that you can rename to a php.ini. I started with the php.ini-production, renamed it to php.ini and modified it as they suggested in the above doc.
- Of course, it was not as easy as that. I kept getting all different kinds of problems when I tried running the Cinema Premiere Personal Server. For a while I was getting Page Not Found and then I made some other changes and then it started trying to download the .php files instead of running them. So I went back and made sure I installed php correctly and researched these problems with php on the internet. I previously had an older version of php installed that ran php5isapi.dll which caused additional issues. I tried so many different things until I finally got it working. This is what I did.
- I went back into Internet Information Services (inetmgr.exe)
- Double click the machine icon for the local computer.
- Right click on "Web Sites" and pick "Properties."
- Click the "Home Directory" tab.
- Click the "Configuration…" button.
- I made sure that .php had the executable panth set to fcgiext.dll located in %WINDIR%\system32\inetsrv.
- Then I went back to the Internet Information Services main window under the local computer I double clicked or opened the Web Sites folder.
- Right click on "Default Web Site" and pick "Properties."
- Click the "Home Directory" tab.
- Click the "Configuration…" button.
- I made sure that .php had the executable panth set to fcgiext.dll located in %WINDIR%\system32\inetsrv. It was not. It was set to php5isapi.dll so I changed it.
- Since I still had problems I modified the php.ini some more. I tried so many different things in the php.ini that I don't remember which fields I ended up setting to what, but this is the php.ini that finally worked. Download php.ini It must be in your php directory.
- I also tried many different settings in the fcgiext.ini located in %WINDIR%\system32\inetsrv until I finally got it to work. Download fcgiext.ini
- Also, just to be sure I rebooted my PC after making these changes. You may be able to just stop and start the services, but I wanted to make sure everything was reset.
To Install older version of PHP
- To unzip using Windows default Extract Wizard
- right click the zip file
- select Extract All...
- click Next
- browse to My Computer > SYSTEM(C:)
- with SYSTEM(C:) highlighted, click Make New Folder
- enter php
- press OK
- in the ...extract to this directory. field you should see C:\php
- press Next
- then press Finish
- To unzip using WinZip
- right click the zip file
- select Extract to...
- select SYSTEM(C:) in the Folders/drives: window
- with SYSTEM(C:) highlighted, click New Folder
- enter php
- press OK
- in the Extract To: field you should see C:\php
- press Extract
- Add c:\php to your Environment Variables
- right click 'My Computer' on desktop
- select 'Properties' -> 'Advanced'
- select 'Environment Variables' at the bottom of the screen
- in 'System variables', scroll down to select 'Path' and press 'Edit'
- add ;C:\php at the end of the 'Variable value:' field (variable values need to be separated by ;)
- press Ok, press Ok, press Ok
Add the .php extension
- For IIS, add it to the Application Mappings.
- Start -> Control Panel -> (Performance and Maintenance) ->Administrative Tools -> Internet Information Services
- Expand your local computer by clicking the +
- Right click on Web Sites
- Select Properties
- Select the Home Directory tab
- Press the Configuration button on the lower right side of the screen
- Press the Add button
- Browse to C:\php
- Change Files of type: at the bottom of the screen to Dynamic Link Libraries (*.dll)
- Double click on php5isapi.dll or select php5isapi.dll and press Open
- Enter .php in the Extension field (be sure to enter the '.' before the php)
- Press OK
- Press Apply
- Press OK
- Press OK
- Close the Internet Information Services screen
- For Abyss,
- Declare the interpreter
- Open Abyss Web Server's console. In the Hosts table, press Configure in the row corresponding to the host to which you want to add PHP support.
- Select Scripting Parameters.
- Check Enable Scripts Execution.
- Press Add in the Interpreters table.
- In the Interpreter field, press Browse..., go to the directory where you have installed PHP and click on php5isapi.dll .
- Set Type to PHP Style.
- Check Use the associated extensions to automatically update the Script Paths.
- Press Add in the Associated Extensions table.
- Enter php in the Extension field and press OK.
- Press OK
- Press Add in the Custom Environment Variables table.
- Enter REDIRECT_STATUS (with no leading or trailing spaces) in the Name field and 200 in the Value field and press OK.
- Press OK in the Scripting Parameters dialog.
- Declare new index files
- Select Index Files.
- Press Add in the Index Files table.
- Enter index.php in the File Name field and press OK.
- Apply the modifications
- Press Restart to restart the server.
- For Apache, in the Apache install folder (C:\Program Files\Apache Group\Apache2 if the default was chosen):
- open the conf folder
- open the httpd.cnf file with notepad or some other text editor
- Add:
- LoadModule php5_module "C:/php/php5apache2.dll"
- Addtype application/x-httpd-php .php
- You may not need to do this step, but if you have a
problem running php files you may need to come back and
configure the path to php.ini
- Search for PHPIniDir and set it to "C:/windows"
- If PHPIniDir is not there, you can add it: PHPIniDir "C:/windows" or
whatever your windows directory
is.
- Save the file and restart the Apache server by clicking
on the Apache icon in the system tray, moving your
cursor over Apache2 and selecting Restart.
Previous | Next | Top |