« Previous Next »

Not Answered Thread: PHP error settings ignored by fastcgi?

Last post 07-11-2008 9:32 AM by martin.meixger. 9 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (10 items)

Sort Posts:

  • 08-24-2007, 6:24 AM

    • Coditor
    • Not Ranked
    • Joined on 06-12-2006, 12:01 PM
    • Posts 5

    PHP error settings ignored by fastcgi?

    Hi,

    I have the following settings in my php.ini:

    error_reporting = E_ALL
    display_errors = Off
    display_startup_errors = Off
    log_errors = On
    log_errors_max_len = 1024
    ignore_repeated_errors = Off
    ignore_repeated_source = Off
    html_errors = On
    error_log = php_error.log

    If I run PHP as isapi, these settings are recognized and errors are not displayed on the site, but are instead logged.

    If I run PHP as fast-cgi, these settings are ignored. Something like <?php echo $testvar; ?> results in a "PHP Notice: Undefined variable: testvar in F:\html\admin\index.php on line 6" being displayed without anything else.

    It seems thru fast-cgi those settings are ignored, and it even aborts execution of the entire page after a notice.

    Running PHP 5.2.3 on IIS 6 (Windows 2003 server).

    Rgds,

    Coditor

  • 08-27-2007, 2:48 AM In reply to

    Re: PHP error settings ignored by fastcgi?

    Hi Coditor,

    Where is your php.ini file? And what does phpinfo(); say your PHPRC environment variable is?

    According to this thread: http://forums.iis.net/t/1079480.aspx. The searching path for PHP ISAPI and FastCGI are different. Try placing php.ini in the same dir as php-cgi.exe.

    Hope it helps.

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 08-27-2007, 9:30 AM In reply to

    • Coditor
    • Not Ranked
    • Joined on 06-12-2006, 12:01 PM
    • Posts 5

    Re: PHP error settings ignored by fastcgi?

    Hi,

    Thanks for your reply. My php.ini file is in C:\PHP5\ and I have no PHPRC environment variable.

    But I have done some more checking, and found this: We have two websites running on that server, one (site "A") is set to anonymous access, the other one (site "B") is set to no anonymous access, and is using windows authentication to let users logon.

    Site "A" works fine, the error is not displayed but is logged instead. Site "B" doesn't work. The settings as displayed by phpinfo are the same (same path to php.ini which it seems to be reading ok, same settings wrt error handling etc.). Both the user for site "A", and the users that are logging in on site "B", are part of the same groups, and have the same security policy settings.

    Note that this is a standard PHP 5.2.3 - we don't compile, just download the binaries from php.net.

    Coditor

  • 08-27-2007, 10:58 PM In reply to

    Re: PHP error settings ignored by fastcgi?

    Hi Coditor,

    Have you check whether one of site is using ISAPI and the other is using FastCGI?

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 08-29-2007, 6:50 AM In reply to

    • Coditor
    • Not Ranked
    • Joined on 06-12-2006, 12:01 PM
    • Posts 5

    Re: PHP error settings ignored by fastcgi?

    Initially I had them all at fast-cgi but because that fails for some sites, those are now running as isapi...

  • 08-30-2007, 4:16 AM In reply to

    Re: PHP error settings ignored by fastcgi?

    Hi Coditor,

    Coditor:

    Thanks for your reply. My php.ini file is in C:\PHP5\ and I have no PHPRC environment variable.

    But I have done some more checking, and found this: We have two websites running on that server, one (site "A") is set to anonymous access, the other one (site "B") is set to no anonymous access, and is using windows authentication to let users logon.

    Site "A" works fine, the error is not displayed but is logged instead. Site "B" doesn't work. The settings as displayed by phpinfo are the same (same path to php.ini which it seems to be reading ok, same settings wrt error handling etc.). Both the user for site "A", and the users that are logging in on site "B", are part of the same groups, and have the same security policy settings.

    Note that this is a standard PHP 5.2.3 - we don't compile, just download the binaries from php.net.

    This is very helpful information. According to this, the problem should be the permission settings of your php.ini. Please goes to the folder of this file and grant read permission for appropriate users. Based on my understanding, using Everyone group should be an easy way.

    And you can refer to following KB article for more detailes:

    HOW TO: Control NTFS Permissions Inheritance in Windows

     

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 08-31-2007, 10:52 AM In reply to

    • Coditor
    • Not Ranked
    • Joined on 06-12-2006, 12:01 PM
    • Posts 5

    Re: PHP error settings ignored by fastcgi?

    Zhao Ji Ma - MSFT:

    Hi Coditor,

    This is very helpful information. According to this, the problem should be the permission settings of your php.ini. Please goes to the folder of this file and grant read permission for appropriate users. Based on my understanding, using Everyone group should be an easy way.

    And you can refer to following KB article for more detailes:

    HOW TO: Control NTFS Permissions Inheritance in Windows

    If the webuser or application pool user couldn't read the php.ini it wouldn't run PHP at all. I've also used filemon which didn't show any "access denied" messages..

    As long as there is no warning, notice or other error in the page, it works fine. But as soon as there is one of those the page is aborted (eventho a warning or notice isn't fatal).

  • 09-04-2007, 11:13 AM In reply to

    Re: PHP error settings ignored by fastcgi?

    Coditor,

    If the webuser or application pool user couldn't read the php.ini it wouldn't run PHP at all. I've also used filemon which didn't show any "access denied" messages..

    As long as there is no warning, notice or other error in the page, it works fine. But as soon as there is one of those the page is aborted (eventho a warning or notice isn't fatal).

    Sorry I'm not PHP engineer. I'm not sure how PHP treated this issue if the application pool running PHP has insufficient permissions accessing php.ini. There might be a default configuration loaded.

    Based on my understanding, you can use Filemon to monitor how the php.ini file is loaded in FastCGI model too. This can help narrow down the issue that is whether PHP in ISAPI model and FastCGI model treated configuration differently.

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • 09-13-2007, 5:40 AM In reply to

    • Coditor
    • Not Ranked
    • Joined on 06-12-2006, 12:01 PM
    • Posts 5

    Re: PHP error settings ignored by fastcgi?

    I've also found that in fast-cgi the set_time_limit function is ignored, returning a 500 server error if the script takes more time than the default ini setting.

    I've given up on fast-cgi, back to isapi for me.

  • 07-11-2008, 9:32 AM In reply to

    Re: PHP error settings ignored by fastcgi?

    Coditor:

    I've also found that in fast-cgi the set_time_limit function is ignored, returning a 500 server error if the script takes more time than the default ini setting.

    I've given up on fast-cgi, back to isapi for me.

    Hi, i had the same problem. Searching for a solution i stumbled up on this thread.

    Now i found the error on my installation:

    I had

    log_errors = On
    error_log = C:\temp\php_error.log

    but access to C:\temp\php_error.log was denied by ACL ( my fault ).

    After enabling access to the logfile, the PHP error messages are no longer written to the output, but logged to the logfile AND script execution continues.

     

Page 1 of 1 (10 items)
Microsoft Communities