|
#1
|
||||
|
||||
PHP Error logging
Find out path to php.ini
The default paths are as follows for popular unix like system:
# php5-cgi -i | grep php.ini How do I log all php errors to a log fiie? Just add following line to /etc/php.ini to log errors to specified file, say /var/log/php-scripts.log or /var/log/httpd/php-error.log: # vi /etc/php.ini Find and modify the error_log directive as follows: error_log = /var/log/php-scripts.log Make sure display_errors set to Off (no errors to end users): display_errors = Off Save and close the file. Restart web server or php7-fpm service: # /etc/init.d/httpd restart OR # systemctl restart httpd.service OR # restart php7.0-fpm How do I see logs? Login using ssh or download a log file /var/log/php-scripts.log using sftp client: $ sudo tail -f /var/log/php-scripts.log Shamelessly stolen from cyberciti.biz With .htaccess file # enable PHP error logging php_value error_reporting VALUE php_flag log_errors on php_value error_log FULL/PATH/php_error_your_domain.log VALUE The value used defines the level or error reporting you require, for example: Create the php_error_your_domain.log file. Shamelessly stolen from here |
#2
|
|||
|
|||
PHP Error logging
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/user/domain/rss.php on line 27
Line 27: itemsvalue = node->getElementsByTagNamevalue->item0->nodeValue; Using as default retrieving rss from p2l. |
Tags |
error , logging , php |
|
|