All pastes #136123 Raw Edit

Someone

public text v1 · immutable
#136123 ·published 2006-08-17 13:06 UTC
rendered paste body
//  CONFIGURE PHP

1. extract php files in C:\Program Files\PHP\

2. Note: In PHP 4, you should move all files located in the dll and      sapi folders to the main folder (e.g. C:\php).

3. To make php4ts.dll / php5ts.dll available: copy the file to the Windows system directory.

4. copy php.ini-recommended or php.ini-dist to c:\Windows and rename it php.ini

Edit php.ini:
doc_root = c:\inetpub\wwwroot 
extension_dir = c:\Program Files\PHP\extensions
cgi.force_redirect = 0



Note: If you're using Windows make sure that the user running the web server has read permissions to your php.ini (e.g. make it readable by Everyone). 



//  CONFIGURE iis

1. If you don't want to perform HTTP Authentication using PHP, you can (and should) skip this step. Under ISAPI Filters, add a new ISAPI filter. Use PHP as the filter name, and supply a path to the php4isapi.dll / php5isapi.dll.


2. Under 'Home Directory', 'Virtual Directory', or 'Directory', do the following:
- Change the Execute Permissions to 'Scripts only'
- Click on the 'Configuration' button, and choose the Application  Mappings tab. Click Add and set the Executable path to the
       appropriate ISAPI DLL. An example PHP 5 value is: C:\php\php5isapi.dll Supply .php as the extension. Leave 'Method
       exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times.
- Stop IIS completely (NET STOP iisadmin)
- Start IIS again (NET START w3svc)


3. Set DirectoryIndex
 In order to use index.php as a default content page, do the following: From within the Documents tab, choose Add. Type in index.php and click OK. Adjust the order by choosing Move Up or Move Down. This is similar to setting DirectoryIndex with Apache.



Other notes: 
For IIS users: If you experience high parsetimes, try to set output_buffering to On. IIS has problems with scripts outputting many small pieces of text, and with output_buffering = On, PHP sends the whole page to IIS in one piece. 

If you experience 100% CPU usage after some time, turn off the IIS setting Cache ISAPI Application.