Where is the php ini file in iis?

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

  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.

To view WinCache configuration and other PHP settings

  1. Open a text editor.

  2. In a new file, type the following text:

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

  4. 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

  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.

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

  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.

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

I am a novice with IIS on Windows Server 2008

My question is basically how to change the path of PHP.ini, due to phpinfo[]; my PHP configuration is loaded from C:\windows when I have my mapped module linked to:

C:\PHP5.4

So How would I go about changing this around, I have performed some research into this subject, but it has not provided me with a solution.

I am on WIndows Server 2008 Running IIS 6.0 with a mapped module of PHP5.4

asked Apr 15, 2013 at 0:59

In Windows, you can set the search location in the registry.

Via the PHP Configuration File:

  • As of PHP 5.2.0, the location of the php.ini file can be set for different versions of PHP. The following registry keys are examined in order: [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z], [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP major, minor and release versions. If there is a value for IniFilePath in any of these keys, the first one found will be used as the location of the php.ini [Windows only].
  • [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath [Windows only].

answered Apr 15, 2013 at 1:26

Mike GMike G

2211 silver badge6 bronze badges

Where is the location of PHP ini?

user. ini file is the default configuration file for running applications that require PHP. It is used to control variables such as upload sizes, file timeouts, and resource limits. This file is located on your server in the /public_html folder.

Where can I find PHP ini in Windows?

In Windows Explorer, open your PHP installation folder, for example C:\PHP . In a text editor, open the php. ini file.

Where can I edit PHP ini?

Modifying the PHP..
Login to the cPanel..
Find the File Manager in File section of the cPanel. ... .
Navigate to the directory where you will either save or edit the PHP. ... .
Edit the section of the PHP. ... .
Click on SAVE CHANGES in the top right hand corner in order to save your modifications or additions to the file..

Where is PHP ini centos8?

ini file comes from in CentOS. These are all of the default configuration files that are installed by the php-common package, we can see here that by default the php. ini file is found at /etc/php. ini.

Chủ Đề