« Previous Next »

Answered Thread: PHP.INI

Last post 10-19-2007 5:47 PM by clay2949. 13 replies.

 

RSS

Page 1 of 1 (14 items)

Sort Posts:

  • 07-16-2007, 12:31 PM

    • wizhuff
    • Not Ranked
    • Joined on 08-31-2005, 12:11 AM
    • Posts 3

    PHP.INI

    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?

  • 07-16-2007, 12:34 PM In reply to

    Re: PHP.INI

    Hi wizhuff,

    Could you give some more information please:

    IIS version?

    PHP SAPI: CGI, FastCGI or ISAPI?

    Thanks,

    Rick.

  • 07-16-2007, 12:43 PM In reply to

    • wizhuff
    • Not Ranked
    • Joined on 08-31-2005, 12:11 AM
    • Posts 3

    Re: PHP.INI

    rickjames:

    Hi wizhuff,

    Could you give some more information please:

    IIS version?

    PHP SAPI: CGI, FastCGI or ISAPI?

    Thanks,

    Rick.

    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!

  • 07-16-2007, 12:54 PM In reply to

    Answered Re: PHP.INI

    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.

  • 07-16-2007, 1:03 PM In reply to

    • wizhuff
    • Not Ranked
    • Joined on 08-31-2005, 12:11 AM
    • Posts 3

    Re: PHP.INI

    rickjames:

    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.

     That was exactly it!!  Thank you! 

  • 10-18-2007, 12:08 PM In reply to

    • clay2949
    • Not Ranked
    • Joined on 10-18-2007, 12:00 PM
    • Posts 5

    Re: PHP.INI

    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.

  • 10-18-2007, 12:36 PM In reply to

    Re: PHP.INI

    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.

  • 10-18-2007, 5:12 PM In reply to

    • clay2949
    • Not Ranked
    • Joined on 10-18-2007, 12:00 PM
    • Posts 5

    Re: PHP.INI

    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
     

  • 10-18-2007, 8:33 PM In reply to

    Re: PHP.INI

    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.

  • 10-19-2007, 11:39 AM In reply to

    • clay2949
    • Not Ranked
    • Joined on 10-18-2007, 12:00 PM
    • Posts 5

    Re: PHP.INI

    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.
     

  • 10-19-2007, 1:29 PM In reply to

    Re: PHP.INI

    checkout www.iis.net/fastcgi

  • 10-19-2007, 2:40 PM In reply to

    • clay2949
    • Not Ranked
    • Joined on 10-18-2007, 12:00 PM
    • Posts 5

    Re: PHP.INI

    I just removed all ISAPI mappings and installed fastcgi successfully.  I am still having the same problem of php not reading the configuration.  Is there another way to diagnose this with fastcgi that wasn't available with isapi? 

  • 10-19-2007, 3:30 PM In reply to

    Re: PHP.INI

    Not really. Just had another idea though: Try moving your php directory to %SystemDrive%\php, if it is not there already.

  • 10-19-2007, 5:47 PM In reply to

    • clay2949
    • Not Ranked
    • Joined on 10-18-2007, 12:00 PM
    • Posts 5

    Re: PHP.INI

     It's already there.  Do you know how to uninstall IIS so that all of the .conf files are removed as well...basically so that I can start with a clean slate and test everything from scratch?  When I uninstall it, it leaves the applicationhost.config file and I don't know if anything else is left behind that contains setting information.

     Thanks.
     

Page 1 of 1 (14 items)