IIS 7 and Above
PATH=sitepath not working in php.ini
Last post May 24, 2011 10:16 AM by HCamper
May 19, 2011 10:21 AM|sk123|LINK
Running PHP 5.3.6 on IIS 7.5. Not sure if this is the correct place to post but here goes...
I have a site setup located at c:\inetpub\phptest. In the 5.3 php.ini under Program Files I have added at the bottom [PATH=c:/inetpub/phptest/] (tried \ and / without ending slash). The local values are never any different from the master ones. I have tried
setting open_basedir as well as a few others but they don't get noticed.
While testing the different formats for the PATH section I found that if I setup the PATH like [PATH=c:\inetpub\] the custom settings work so maybe it is a bug that the path has to be set to the parent path of the root directory or maybe I just didn't understand
what should go in the PATH section.
Ideas? Is this a bug or am I supposed to be setting the PATH to be one level up from where the root of my site is?
Thanks in advance for your reply.
May 20, 2011 06:08 AM|HCamper|LINK
Have you checked
for PHP per Site Configuration.
It unclear from your post where the PHP installation is located is in the C:\inetpub or C:\Program Files\PHP?
The problems with "PATH" are how you use Upper & Lower Case and how 8.3 Long File Names get processed.
The configuration of PHP installation and Web Sites can fail for difference in use of c:\ vs C:\. in some cases
you need to use "C:\Program Files\" C:\Progra~1\ to work around the "PATH" limitations.
I suggest that you first verify the basic test.php for command line then add the "Handler" & Mapping"
for the IIS Server. Guide for "Handler" http://learn.iis.net/page.aspx/724/install-and-configure-php/ .
The Recycling Process Guide
Test and verify the PHP installation for the test.php
Then you add the "Handler" to the Web Sites.
Then you can use the Enable Per Site information to extend PHP for other Web Sites.
May 24, 2011 07:35 AM|sk123|LINK
The PHP install is located in the c\program files (x86)\php\v5.3\. I installed it using the Web Platform Installer. From your reply it sounds like my question was not clear so let me try to make it a bit more clear.
Following the examples in the article:
I am trying to set custom settings for my PHP site which is located at c:\inetpub\sitename\ so based on the article I should at the end of the php.ini file located under the php install directory add the following line: [PATH:c:/inetpub/sitename/] with the
custom setting for that site directly under that line seems simple enough but it doesn't work for me.
The only way I could get it working was to set the [PATH:] to the parent directory of the root of my website so in my example it would only take effect when the PATH in the php.ini file was set to c:/inetpub/ (note it is one level above the root of my site).
I hope this is more clear now. Thanks!
May 24, 2011 07:45 AM|HCamper|LINK
If you look at Ruslany Post and the picture for the two Web Site examples:
look carefully at the path the "C:/" is important and is different than
I think if you make the path case change it may help.
A thought to consider for PHP configuration and per site management
is maybe download the PHP Manager from IIS Net Download Center and install the tool.
The recent versions of PHP Mananger take the pain out of this kind of configuration.
May 24, 2011 08:51 AM|sk123|LINK
I tried it like you said with the uppercase C but still a no go. The case doesn't seem to matter in my tests as long as I am pointing it to the parent of my web root. As long as it was pointing to the parent then I could also use a forward or back slash
both worked fine. I tried this on my server which is running Windows Server 2008 R2 with IIS 7.5 as well as with my desktop running Windows 7 Professional with IIS 7.5 too it appears.
Maybe this is because I'm running IIS 7.5 and not IIS 7.0?
May 24, 2011 10:16 AM|HCamper|LINK
Most times that fixes things.
I suggest then PHP Mananger http://phpmanager.codeplex.com/ can help with configuration so download
the installer and select X86 or X64 and Make a Backup of your php.ini file(s).
Then install PHP Manager and do the configuration for PHP install location and the per-site settings.
A warning if the PHP Manager shows settings are not optimized look carefully at what is shown.
Do not select use "index.php" as your default document unless that is desired.