PHP errors not logged, blank PHP pages

#1
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
 
#3
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:
#7
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.
 

webizen

Well-Known Member
#8
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.
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:
#9
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
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.
 

webizen

Well-Known Member
#11
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.
 
#13
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.
 
#15
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.
 
Top