Guida all’installazione del php su IIS di windows.
- Download the PHP installation package version 4.1.2 or higher available at http://www.php.net/downloads.php.
- Unpack the archive (for example: to d:php).
- Rename the file php.ini-recommended to php.ini. Copy php.ini to x:Windows.
- Open the file php.ini in any text editor. Replace extension_dir =
with extension_dir = d:phpextensionsReplace doc_root =
with doc_root = "d:Inetpubwwwroot"Replace cgi.force_redirect = 1
with cgi.force_redirect = 0Save changes.
- Click the Home Directory tab.
- In the Application settings section, select Scripts and Executables in the Execute Permissions drop-down list.
- Then, click the Configuration button beside.
- Click the Mappings tab.
Applying extensions to the whole site on the Mappings tab allows the selected extensions to be used with all virtual folders of the site. - Click Add to set the path to ISAPI.DLL and specify the php file extension.
- Fill in the dialog box fields in the following way:
Executable: click Browse to locate php4isapi.dll or type or paste the path name: d:phpsapiphp4isapi.dll;
Extension: type .php;Uncheck the Verify that file exists box. Check the Script Engine box.
- Click OK in each open dialog box to save changes.
- Right-click the Web Service Extensions item in the IIS tree pane. In the context menu, select the Add a New Web service extension item.
- Click Add in the Required file section to assign a new filter name (.php) and the path to php4isapi.dll. This file should reside in d:phpsapiphp4isapi.dll.
- Check the Set extension status to Allowed box.
- Click OK.
- Now you have to make index.php a default page. Do the following.
- Right-click your site in the Web Sites tree. In the context menu, select Properties.
- Click the Documents tab.
- Click Add.
- The Add Content Page dialog box will open. Type index.php in the Default content page field.
- Click OK.
- A new entry index.php is added to the end of the list. Click the Move Up button until you move index.php to the top.
- Save changes by clicking OK.
- For the changes to take effect, stop the IIS and then start it again.
Checking PHP
- Create a test.php file. Type the following directive in it:
<? phpinfo(); ?>
- Save the file in the root folder of the site.
- Open the file in the browser: http://localhost/test.php.
- The browser will display the table with the PHP settings which should look like follows (it means that PHP is properly configured on your server):
- Create a test.php file. Type the following directive in it: