PHP errors not logged, blank PHP pages

Discussion in 'General' started by MH-Stefan, Apr 28, 2011.

  1. MH-Stefan

    MH-Stefan New Member

    Hello,

    Last week we've switched from Apache to LSWS. So far we've been able to iron out most of the issues, except for one: it seems that some PHP errors aren't logged.
    We have clients reporting that various scripts which worked flawlessly on Apache are now simply displaying a blank page. The error logs don't show anything and PHP error reporting is enabled.

    The server is running PHP 5.2 in suPHP mode, with eAccelerator, mod_security and Suhosin.

    Any advice would be greatly appreciated. Thank you in advance!

    Regards,
    Stefan
  2. NiteWave

    NiteWave Administrator

    compare phpinfo() under apache and lsws, see if difference.
  3. MH-Stefan

    MH-Stefan New Member

    They're both identical. It seems that the issues we have may be caused either by Suhosin or by mod_security, but the errors are not logged or displayed anywhere. Any idea why Suhosin/mod_security errors aren't logged under LSWS?

    Edit: Sometimes we get the error 406 with a blank page when submitting a form.
    Last edited: Apr 29, 2011
  4. NiteWave

    NiteWave Administrator

    how about disable Suhosin in lsphp5, see if no error?
  5. MH-Stefan

    MH-Stefan New Member

    Thanks, I've turned on suhosin.simulation and now we can submit the form, but the suhosin errors are still not logged as they should.
  6. webizen

    webizen New Member

    are you using cpanel? did you also check stderr.log as well?
  7. csdco

    csdco New Member

    I would also like to know this. I have all errors turned on and can see them in my browser, but they are never logged at /service/serviceMgr.php?vl=1. We are not using cpanel.
  8. webizen

    webizen New Member

    you should choose different Display Level (such as debug, info, etc) to see if the logs show up.

    you may also check error log and stderr log from command line which should display all that is logged.

    Edit: make sure log level (admin cp=>configuration=>server=>log) is set to debug or info.
    Last edited: Jan 26, 2012
  9. csdco

    csdco New Member

    Configuration >> Server >> Log >> Server Log has:
    Log Level: DEBUG
    Debug Level: NONE
    Rolling Size: 10M
    Enable stderr log: Yes

    With these options I still see no php errors in the log.

    Here's what phpinfo() is reporting for error reporting. The error_reporting directive looks odd to me. Also, should I be specifying a log manually in php.ini or does Litespeed automatically capture error messages from php the way Apache's error.log would?

    Code:
    Directive		Local Value		Master Value
    display_errors		On			On
    error_append_string	no value		no value
    error_log		no value		no value
    error_prepend_string	no value		no value
    error_reporting		30719			no value
  10. csdco

    csdco New Member

    I took a hint from my phpinfo() and added the following lines to /usr/local/lsws/lsphp5/lib/php.ini:

    Code:
    log_errors = On
    error_log = /usr/local/lsws/logs/php_errors.log
    Then I created the file php_errors.log and gave it proper ownership for Litespeed:

    Code:
    echo > /usr/local/lsws/logs/php_errors.log
    chown nobody /usr/local/lsws/logs/php_errors.log
    chgrp nogroup /usr/local/lsws/logs/php_errors.log
    Now all of my PHP errors are being logged here. I can't see them in the convenient Litespeed control panel, but I'm used to tail'ing them via SSH anyways so I'm still happy.
  11. webizen

    webizen New Member

    Litespeed Admin Console only displays what's in /usr/local/lsws/logs/error.log. You may try that for error_log in php.ini as you did for php_errors.log.
  12. csdco

    csdco New Member

    Good point :) I didn't think about dumping errors into error.log since it was used by Litespeed, but I guess it's no different.
  13. csdco

    csdco New Member

    Well, now I have another question on this. If PHP has a more fatal error such as a segmentation fault, I'm receiving nothing on the screen and nothing in the logs.

    This is with display_errors = On and error_log = set to the Litespeed error log file.

    On Apache, the identical script was displaying the PHP error with segmentation fault details on screen.
  14. webizen

    webizen New Member

    anything in stderr.log?
  15. csdco

    csdco New Member

    Nope, nothing in there. Running the script that I know was producing the segmentation fault via the command line produces segfault:

    Code:
    $ php test.php
    Segmentation fault.
    $ 
    but that's it. I guess I will have to let this one go, happy that everything else is being logged and that I know a bit more about how all of this works.

Share This Page