How to generate error log for failing php script
Hello,
I have a problematic php script i'm trying to work on, but no error log is being generated. Some research shows that maybe it's related to suphp. I've tried making some changes to /usr/lib/php.ini and they don't seem to take (or logs aren't being written).
The script actually broke after i upgraded php to 5.3.28 a few days ago.
Here's some info on versions:
Any assistance would be appreciated.
[~]# php --version
PHP 5.3.28 (cli) (built: Apr 16 2014 01:53:31)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
[~]# /usr/local/cpanel/bin/rebuild_phpconf --current
Available handlers: suphp dso cgi none
DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: suphp
SUEXEC: enabled
RUID2: not installedAny assistance would be appreciated.
-
Hello :) What changes did you make to the /usr/local/lib/php.ini file? Make sure the "log_errors" value is "ON". Also, check to see if there is a php.ini file within the account's home directory that is taking precedence. Thank you. 0 -
[quote="cPanelMichael, post: 1629872"> What changes did you make to the /usr/local/lib/php.ini file? Make sure the "log_errors" value is "ON". Also, check to see if there is a php.ini file within the account's home directory that is taking precedence.
I had changed "log_errors = Off" to "log_errors = On" (for /usr/local/lib/php.ini) and it didn't seem to have any effect. Do i need to restart apache after each change? There's no php.ini in the account's home folder. I guess i'd rather do that, than turn on logging for everything. What's the best way to implement it, just a single line with "log_errors = On"?0 -
Yes, restart Apache after making that change to the global php.ini file. You should copy the entire /usr/local/lib/php.ini file to the account's home directory rather than just creating the file with the single line. Thank you. 0 -
Okay, i copied /usr/local/lib/php.ini to /home//php.ini. I edited the php.ini file with these changes (comments removed): error_reporting = E_ALL log_errors = On error_log = error_log
That didn't work. So i tried adding the full path to the log:error_reporting = E_ALL log_errors = On error_log = /home//error_log
Still no :( So i created the file error_log and chowned it to the account. Still nothing. To generate errors i'm using a sample found here: [url=http://us1.php.net/trigger_error]PHP: trigger_error - Manual Any tips on what i've done wrong? [COLOR="silver">- - - Updated - - - Worth mentioning -- Using the php.net error trigger, i do get an error in my browser.0 -
What is the specific error message that you see in your browser? Thank you. 0
Please sign in to leave a comment.
Comments
5 comments