Page 1 of 1

error_log per website?

Posted: Sat Feb 04, 2017 7:42 pm
by lucasbustamante
I just installed VestaCP with Apache + NGINX. It's an amazing tool, but now I would like to configure the PHP error_log variable to save the error.log file on each virtual host:

Final result would be something like this:
/home/admin/web/mywebsite.com/logs/error.log

I saw it already creates a shortcut to the error.log on the folder above, but when I use an additional ftp account, I don't have permission to access it.

Re: error_log per website?

Posted: Mon Feb 06, 2017 3:50 am
by plutocrat
You should be able to do this by setting the values in an .htaccess file for each site. How are you currently doing it?

Something like this perhaps

Code: Select all

# Don't show PHP errors in browser.
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off

# Send errors to a file instead. 
php_flag log_errors on
php_value error_reporting 32767
php_value error_log "/home/admin/web/domain.com/logs/php-error.log"
You'd probably have to add /home/admin/web/domain.com/logs/ in your openbasedir directive ...