Skip to main content
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Configuring Step 2: Configure PHP Settings
- Article
- 05/14/2020
- 2 minutes to read
In this article
by Keith Newman and Robert McMurray
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.
2.1. Configure WinCache
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.
To configure the WinCache PHP extension
- In Windows Explorer, open your PHP installation folder, for example
C:\PHP
. - Choose either the php.ini - development or php.ini - production file, and rename it php.ini.
- In a text editor, open the php.ini file and added the following line at the end of the file:
extension = php_wincache.dll
. - Save and close the php.ini file.
- Recycle the IIS Application Pools for PHP to pick up the configuration changes.
To view WinCache configuration and other PHP settings
Open a text editor.
In a new file, type the following text:
Save the file as
c:\inetpub\wwwroot\phpinfo.php
.Open a browser and enter the following URL:
//localhost/phpinfo.php
A nicely formatted web page is displayed showing the current PHP settings. The WinCache settings appear in a section called wincache.
Warning: Delete the phpinfo.php file when it's no longer needed.
2.2. Configure Other PHP Settings
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.
To configure a PHP setting
In Windows Explorer, open your PHP installation folder, for example
C:\PHP
.In a text editor, open the php.ini file.
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.
Save and close the php.ini file.
Recycle the IIS Application Pools for PHP to pick up the configuration changes.
2.3. Configure PHP Extensions
The following procedure shows how to download and install a PHP extension. For information about PHP extensions, see 2.3 Plan PHP Extensions.
To configure a PHP extension
- Download the PHP extension you want from the list of Windows extensions for PHP.
- Extract the extension zip package to the PHP extensions folder [\ext], for example
C:\PHP\ext
. - In Windows Explorer, open your PHP installation folder, for example
C:\PHP
. - In a text editor, open the php.ini file.
- 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
. - Save and close the php.ini file.
- Recycle the IIS Application Pools for PHP to pick up the configuration changes.
See Also
- Configure a PHP Website on IIS
- Step 2: Plan PHP Settings
- Step 1: Install IIS and PHP
- Step 3: Configure PHP Application Security
- Hosting-Friendly Web Server Platform [IIS]: Scenario Overview
Chuyển đến nội dung chính
Trình duyệt này không còn được hỗ trợ nữa.
Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật.
Tải xuống Microsoft Edge Xem thêm thông tin về Internet Explorer và Microsoft Edge
Đọc bằng tiếng Anh
Đọc bằng tiếng Anh Chỉnh sửa
Microsoft.Extensions.Configuration.Ini Namespace
- Reference
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
In this article
Classes
IniConfigurationProvider | An INI file based ConfigurationProvider. Files are simple line structures [INI Files on Wikipedia]. |
IniConfigurationSource | Represents an INI file as an IConfigurationSource. Files are simple line structures [INI Files on Wikipedia]. |
IniStreamConfigurationProvider | An INI file based StreamConfigurationProvider. |
IniStreamConfigurationSource | Represents an INI file as an IConfigurationSource. Files are simple line structures [INI Files on Wikipedia]. |