• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

fastcgi sites do not log php errors! BUG?

deltatech

Regular Pleskian
I recently switched all my sites from apache module to fastcgi using php 5.4.23 and I can't get php to log errors.

To prove it is not logging errors I created a php script like this..

Code:
<?
// This should throw an error as it is a non existant function
nonexistant_function(garbage);
?>

The result in the browser is a blank page, no error messages.

That should show up in the error log but it does not.. Yet I see apache errors ok in the error log, just not php errors.

The php.ini in the settings for that site show
display_errors = On
log_errors = On

Also If I create a php script with phpinfo(); in it, it says
display_errors on
log_errors on

in my conf/last_httpd_ip_default.conf I see this...
ErrorLog "/var/www/vhosts/system/mysite.com/logs/error_log"

The log where I expect to see the errors is in /var/www/vhosts/system/mysite.com/logs/error_log

I get all the apache errors just fine, just NOTHING from php,.

Some sites on my server log ok, but most have this same problem

I would apprecate any help I can get on this.. I can't debug my php when I can't see the error output.

Also, if it makes any difference, I have the nginx proxy disabled on my server.
 
Try to add there following line:

error_reporting = E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR
 
Try to add there following line:

error_reporting = E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR

Thanks for the fast reply.. I just did that as you said.. Previously I had error_reporting = E_ALL either way, it still doesn't log

I have tested this problem on about 10 sites so far and only 2 of the 10 have the problem.

Did I mention before that even display_errors = on and display_startup_errors = on still display nothing? Yet I can capture the errors in a script within php and log it to sql just fine.

Its as if it is logging to another place. I checked the default /var/log/httpd/error_log but nothing there either.
 
igor help!

This BUG is now well defined. In plesk panel you can NOT use anything but defaults in the php settings for error_reporting. It puts double quotes around it causing PHP to not log errors. This is easy to duplicate. I hope parallels will look into this as there are probably many other php settings that will behave the same way.

To duplicate this bug

go to any fastCGI doman
go to php settings
change error_reporting to anything but default
php will not log to the error_log

reason for not logging is that in the generated php.ini there are double quotes around the value preventing PHP from logging or displaying any errors

in my case, my main /etc/php.ini has error_reporting = E_ALL & ~E_NOTICE if I select a value other than default the generated /var/www/vhosts/system/mydomain.com/etc/php.ini has error_reporting = "E_ALL & ~E_NOTICE" which does not work because of the double quotes.. Change the setting to default and it does it right, it then shows error_reporting = E_ALL & ~E_NOTICE in the generated php.ini file and logging works correctly.

Plesk Panel version 11.5.30 Update #27
OS CentOS 6.5
PHP Version: 5.4.23
 
Last edited:
Back
Top