I've installed PHP on my Vista machine and placed the ini in C:\Windows
When I bring up a page with PHP_INFO it shows it's reading the correct INI (Loaded Configuration File C:\Windows\php.ini) however inside the INI file I set the extension_dir to c:\php5\ext yet the php_info shows:
extension_dir ./
And it's not loading some of the modules i've uncommented. I've also tried changing the security on the ini file to everyone.... but it does not appear to be reading it although it says it is.
IIS7 - PHP 5.2.3 ISAPI.running on Vista Ultimate Edition.
What I'm trying to do in the log run is get PHP working with mySQL but my problem right now is it's not even trying to load the php_mysql.dll cause I believe it's not reading the INI file although it claims to be.
This is my first time working with PHP so I could be missing something blaringly obvious. I got PHP up and running by following this blog:
What's probably getting you is when php.ini is read. When run as an ISAPI, I'm guessing it's only read during w3wp.exe startup. This means that to see a change, you'll need to recycle your application pool for php.ini to be read again. (e.g. start - run
- inetmgr - "Application Pools" - DefaultAppPool - Recycle)
When run as FastCGI, php.ini is only read when php-cgi.exe starts (by default: every 200 requests or after 5 minutes of inactivity).
When run as CGI, php.ini is read on every request.
What's probably getting you is when php.ini is read. When run as an ISAPI, I'm guessing it's only read during w3wp.exe startup. This means that to see a change, you'll need to recycle your application pool for php.ini to be read again. (e.g. start - run
- inetmgr - "Application Pools" - DefaultAppPool - Recycle)
When run as FastCGI, php.ini is only read when php-cgi.exe starts (by default: every 200 requests or after 5 minutes of inactivity).
When run as CGI, php.ini is read on every request.
I'm running as ISAPI and I have tried recycling my application pool as well as restarting the server to no avail. I am trying to change a couple of configuration settings, short_open_tag and display_errors. They are both set to off by default. I have
changed both of them to on in the php.ini file and no change took affect per the phpinfo() output. The only thing that has an affect is when I remove the php.ini file from the c:\windows directory, then the settings both change to on, even though the "loaded
configuration" is empty. It seems as if it's pulling them from some cache. As soon as I put the file back, the settings go back to off, even though they are both set to on in the file.
Any suggestions would be much appreciated, this is definitely driving me mad.
Thanks a lot for your quick response...sorry for my delayed response, i thought that I had enabled the email...anyway.
1. The w3wp.exe PIDs are changing when I restart the web server and there is only one of them
2. With procmon, it seems that it is loading the correct one, c:\windows\php.ini. There are also entries in there where it is trying to load C:\Windows\SysWOW64\inetsrv\php.ini but it doesn't find that file because it doesn't exist. After it fails to find
the file there it then reads it from C:\windows\php.ini.
3. Other settings don't work. I tried to enable a couple of extensions and they don't show up.
wizhuff
3 Posts
PHP.INI
Jul 16, 2007 04:31 PM|LINK
I've installed PHP on my Vista machine and placed the ini in C:\Windows
When I bring up a page with PHP_INFO it shows it's reading the correct INI (Loaded Configuration File C:\Windows\php.ini) however inside the INI file I set the extension_dir to c:\php5\ext yet the php_info shows:
extension_dir ./
And it's not loading some of the modules i've uncommented. I've also tried changing the security on the ini file to everyone.... but it does not appear to be reading it although it says it is.
Any ideas or suggesions?
rickjames
193 Posts
Microsoft
Re: PHP.INI
Jul 16, 2007 04:34 PM|LINK
Hi wizhuff,
Could you give some more information please:
IIS version?
PHP SAPI: CGI, FastCGI or ISAPI?
Thanks,
Rick.
wizhuff
3 Posts
Re: PHP.INI
Jul 16, 2007 04:43 PM|LINK
Sorry about that.
IIS7 - PHP 5.2.3 ISAPI.running on Vista Ultimate Edition.
What I'm trying to do in the log run is get PHP working with mySQL but my problem right now is it's not even trying to load the php_mysql.dll cause I believe it's not reading the INI file although it claims to be.
This is my first time working with PHP so I could be missing something blaringly obvious. I got PHP up and running by following this blog:
http://blogs.iis.net/bills/archive/2006/09/19/How-to-install-PHP-on-IIS7-_2800_RC1_2900_.aspx
but I seem to be having problems with the INI file.
Thanks!
rickjames
193 Posts
Microsoft
Re: PHP.INI
Jul 16, 2007 04:54 PM|LINK
What's probably getting you is when php.ini is read. When run as an ISAPI, I'm guessing it's only read during w3wp.exe startup. This means that to see a change, you'll need to recycle your application pool for php.ini to be read again. (e.g. start - run - inetmgr - "Application Pools" - DefaultAppPool - Recycle)
When run as FastCGI, php.ini is only read when php-cgi.exe starts (by default: every 200 requests or after 5 minutes of inactivity).
When run as CGI, php.ini is read on every request.
wizhuff
3 Posts
Re: PHP.INI
Jul 16, 2007 05:03 PM|LINK
That was exactly it!! Thank you!
clay2949
5 Posts
Re: PHP.INI
Oct 18, 2007 04:08 PM|LINK
I'm running as ISAPI and I have tried recycling my application pool as well as restarting the server to no avail. I am trying to change a couple of configuration settings, short_open_tag and display_errors. They are both set to off by default. I have changed both of them to on in the php.ini file and no change took affect per the phpinfo() output. The only thing that has an affect is when I remove the php.ini file from the c:\windows directory, then the settings both change to on, even though the "loaded configuration" is empty. It seems as if it's pulling them from some cache. As soon as I put the file back, the settings go back to off, even though they are both set to on in the file.
Any suggestions would be much appreciated, this is definitely driving me mad.
rickjames
193 Posts
Microsoft
Re: PHP.INI
Oct 18, 2007 04:36 PM|LINK
Hi clay2949,
1) Are the w3wp.exe PIDs changing? Is there more than 1 w3wp.exe?
2) Which php.ini do you see w3wp.exe loading? (use procmon from www.sysinternals.com to watch)
3) Do other settings work? e.g. if you disable/enable an extension does it disappear/appear in phpinfo()?
Cheerz,
Rick.
clay2949
5 Posts
Re: PHP.INI
Oct 18, 2007 09:12 PM|LINK
Thanks a lot for your quick response...sorry for my delayed response, i thought that I had enabled the email...anyway.
1. The w3wp.exe PIDs are changing when I restart the web server and there is only one of them
2. With procmon, it seems that it is loading the correct one, c:\windows\php.ini. There are also entries in there where it is trying to load C:\Windows\SysWOW64\inetsrv\php.ini but it doesn't find that file because it doesn't exist. After it fails to find the file there it then reads it from C:\windows\php.ini.
3. Other settings don't work. I tried to enable a couple of extensions and they don't show up.
Thanks again for getting right back to me.
-Clay
rickjames
193 Posts
Microsoft
Re: PHP.INI
Oct 19, 2007 12:33 AM|LINK
Hi Clay,
Then I've got no idea. Additional things I'd try:
1) see if running php from the command line respects your config, e.g. \php\php.exe \inetpub\wwwroot\phpinfo.php
2) Use FastCGI .. ;-)
Cheerz,
Rick.
clay2949
5 Posts
Re: PHP.INI
Oct 19, 2007 03:39 PM|LINK
When I run it from the command line, it does pick up the config...now I'm really pulling my hair out!
I am not opposed to using FastCGI if you could point me in the direction of a good howto on installing it that way.
Thanks again for your help.