Opened 3 years ago
Closed 3 years ago
#32 closed task (fixed)
PHP error logs not found
Reported by: | mori | Owned by: | chris |
---|---|---|---|
Priority: | major | Milestone: | Maintenance |
Component: | crin2 | Version: | |
Keywords: | Cc: | ||
Estimated Number of Hours: | 0 | Add Hours to Ticket: | 0 |
Billable?: | yes | Total Hours: | 1 |
Description
I'm having issues on newprod, but I can't find PHP error logs. If they are logged, can you please let me know where they are? If they are not logged, can you start logging them on both CRIN2 and CRIN4? Thanks.
Change History (2)
comment:1 Changed 3 years ago by chris
comment:2 Changed 3 years ago by chris
- Add Hours to Ticket changed from 0 to 1
- Resolution set to fixed
- Status changed from new to closed
- Total Hours set to 1
I have done this on Crin4 and Crin2, in /etc/php5/fpm/pool.d/www.conf the following line was added:
php_admin_value[error_log] = /var/log/php/error.log
The directory was created and chowned:
mkdir /var/log/php chown www-data:www-data /var/log/php
I have set these logs to be rotated daily and for 60 days worth to be kept by creating /etc/logrotate.d/php5-fpm_errorlog containing:
/var/log/php/error.log { rotate 60 daily missingok notifempty compress delaycompress postrotate /usr/lib/php5/php5-fpm-reopenlogs endscript }
php-fpm was restarted:
service php5-fpm restart
I have confirmed that it is working, visit this URL on the dev server: https://dev.crin.org/en/library/countries/algeria and the following is written to /var/log/php/error.log:
[24-Aug-2015 11:47:37 Europe/London] PHP Parse error: syntax error, unexpected end of file in /var/www/dev/docroot/sites/all/themes/crin/templates/node--country.tpl.php on line 522
There are also errors written to the Crin2 error log, visit https://www.crin.org/sites/default/settings.php and the following line (amoung others) is written to /var/log/php/error.log:
[24-Aug-2015 10:55:37 UTC] PHP Notice: Use of undefined constant DRUPAL_ROOT - assumed 'DRUPAL_ROOT' in /var/www/prod/docroot/sites/default/settings.php on line 492
I think that resolves this ticket, feel free to re-open it if there are any problems / issues.
Sorry for the delay in responding to this ticket. By default php5-fpm doesn't generate error logs but I will enable this tomorrow.