0

I am setting up a webserver in CentOS 7 with multiple virtual hosts which includes a drupal website. I want to log the PHP errors of my Drupal website, say 'mysite' to a custom file say, /var/log/httpd/mysite_error.log. I have set this up in the httpd conf file of the virtual host (and this has worked for non-Drupal sites) but the errors are still logged to /var/log/php_error.log.

httpd conf file of the virtual host mysite (/etc/httpd/sites-available/mysite):

<VirtualHost *:80>
    ServerName mysite
    DocumentRoot /var/www/html/mysite/
    <Directory "/var/www/html/mysite">
        AllowOverride All
    </Directory>
    ErrorLog /var/log/httpd/mysite_error.log
    CustomLog /var/log/httpd/error_log combined
</VirtualHost>
1
  • Drupal also logs errors for him self. Did you check under Reports -> Recent log messages? Maybe that can be helpful for you? Commented Sep 11, 2019 at 8:54

2 Answers 2

0

You're just defining the Apache error log. For php you need php_value error_log /path/to.log.

See most topvoted answer at error_log per Virtual Host?

Sign up to request clarification or add additional context in comments.

Comments

0

For Php Errors you have to configure them too, and they're are not ErrorLog or CustomLog as you declared here, these are servers log. Php errors variables start with php_value or php_flag.

<VirtualHost *:80>
    ServerName mysite
    DocumentRoot /var/www/html/mysite/
    <Directory "/var/www/html/mysite">
        AllowOverride All
    </Directory>
    ErrorLog /var/log/httpd/mysite_error.log
    CustomLog /var/log/httpd/error_log combined
    php_flag log_errors on
    php_flag display_errors on
    php_value error_reporting 2147483647
    php_value error_log /var/www/domains/example.com/php.error.log
</VirtualHost>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.