Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

Step 2: Configure PHP Settings

Published: May 4, 2012

Updated: May 4, 2012

Applies To: Windows Server 2012, Windows Server 2012 R2



In this step of building a PHP website on IIS, you configure the WinCache PHP extension, configure PHP settings, and download and configure any other PHP extensions that your application requires.

When you complete these tasks, continue to Step 3: Configure PHP Application Security.

Before you perform this procedure, you should download in install PHP and WinCache as described in 1.2 Download and Install PHP.. For more information about WinCache, see 2.1. Plan WinCache Configuration.

  1. In Windows Explorer, open your PHP installation folder, for example C:\PHP.

  2. Choose either the php.ini - development or php.ini - production file, and rename it php.ini.

  3. In a text editor, open the php.ini file and added the following line at the end of the file: extension = php_wincache.dll.

  4. Save and close the php.ini file.

  5. Recycle the IIS Application Pools for PHP to pick up the configuration changes.

  1. Open a text editor.

  2. In a new file, type the following text: <?php phpinfo(); ?>

  3. Save the file as c:\inetpub\wwwroot\phpinfo.php.

  4. Open a browser and enter the following URL: http://localhost/phpinfo.php

    A nicely formatted web page is displayed showing the current PHP settings. The WinCache settings appear in a section called wincache.

    WarningWarning
    Delete the phpinfo.php file when it’s no longer needed.

The following procedure explains how to configure PHP settings in the php.ini file. For more information about PHP settings, see 2.2. Plan other PHP settings.

  1. In Windows Explorer, open your PHP installation folder, for example C:\PHP.

  2. In a text editor, open the php.ini file.

  3. Search the file for the setting you want to change.

    If the setting is commented out (line begins with a semicolon [;]), delete the semicolon and set the value. If you can’t find the setting, add the line to the end of the file.

  4. Save and close the php.ini file.

  5. Recycle the IIS Application Pools for PHP to pick up the configuration changes.

The following procedure shows how to download and install a PHP extension. For information about PHP extensions, see 2.3 Plan PHP Extensions.

  1. Download the PHP extension you want from the list of Windows extensions for PHP.

  2. Extract the extension zip package to the PHP extensions folder (\ext), for example C:\PHP\ext.

  3. In Windows Explorer, open your PHP installation folder, for example C:\PHP.

  4. In a text editor, open the php.ini file.

  5. Search the file for the extension you want to configure.

    If the extension is commented out (line begins with a semicolon [;]), delete the semicolon. If you can’t find the extension, add it to the end of the file. A line that adds an extension is in the form: extension = extension_name.dll. For example: extension = php_soap.dll.

  6. Save and close the php.ini file.

  7. Recycle the IIS Application Pools for PHP to pick up the configuration changes.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.