Link to home
Start Free TrialLog in
Avatar of LeighWardle
LeighWardleFlag for Australia

asked on

Logging PHP errors

Hi Experts,

I am using WordPress and I believe one of my plugins is throwing fatal PHP errors.
But these errors are not showing up in my PHP error log.

Here are the current PHP settings reported by phpinfo():


Directive	Local Value	Master Value
display_errors	Off	Off
display_startup_errors	Off	Off
error_append_string	</font>	</font>
error_log	no value	no value
error_prepend_string	<font color=ff0000>	<font color=ff0000>
error_reporting	32767	32767
log_errors	On	On
log_errors_max_len	1024	1024
track_errors	Off	Off

Open in new window


What changes do I need to make so that all error levels are included in my PHP error log?
Also what is the difference between Local Value and Master Value?

Regards,
Leigh
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LeighWardle

ASKER

Hi Dave,

Sorry, I had not mentioned earlier, there already appears to an 'error_log' file active, with contents like this:

PHP Warning:  Module 'json' already loaded in Unknown on line 0
PHP Warning:  Module 'sockets' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
PHP Warning:  Module 'json' already loaded in Unknown on line 0
PHP Warning:  Module 'mysqlnd' already loaded in Unknown on line 0
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'mysqlnd' already loaded in Unknown on line 0
PHP Warning:  Module 'mysqli' already loaded in Unknown on line 0
PHP Warning:  Module 'mysqlnd' already loaded in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Warning:  Module 'pdo_mysql' already loaded in Unknown on line 0
PHP Warning:  Module 'PDO' already loaded in Unknown on line 0
PHP Warning:  Module 'json'
PHP Warning:  PHP Startup: Unable to load dynamic library
'/opt/alt/php55/usr/lib64/php/modules/ffmpeg.so' - libswscale.so.2:
cannot open shared object file: No such file or directory in Unknown on
line 0

Open in new window


So I assume it is already logging Warnings, but not higher level errors?
Yes, but the only way you get those warnings is to have those extensions defined twice in 'php.ini'.  Are you on Windows or Linux?
I'm on a Linux-based website hosting service.
Do you have your own 'php.ini' in your web space?
No, I don't have my own 'php.ini' in my web space.
I guess I will have ask my host to make the changes?
You should ask them why you are getting those warnings about the extensions being already loaded.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many Thanks, Dave & Ray.