A
A
Alexander2017-03-31 11:45:22
PHP
Alexander, 2017-03-31 11:45:22

How to enable PHP error logging in error.log in current folder automatically on Apache?

VPS on Centos 7.3 with Webuzo control panel. apache, php. How to enable, so that errors when executing PHP files are written to error.log in the same directory? Perhaps they are still being written, but somewhere in general for the server, but it needs to be in the current directory. Is it something that needs to be enabled in php.ini?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2017-03-31
@sanok_ps

Found a solution.
Since it costs suPHP, you can set the settings in a local ini file in each directory, or in a common one for some. But the local file should not be called php.ini , but .user.ini (this default value was found as a result of the output of the phpinfo function). In it he wrote:
error_log = error_log

N
Nikolay, 2017-03-31
@iNickolay

in the Apache settings, in the VirtualHost directive, specify the path to the ErrorLog.
Something like:

<VirtualHost 192.168.11.12>
DocumentRoot "/home/webs/mywebsite/html/"
ServerName mywebsite.com
ErrorLog /home/webs/mywebsite/logs/error.log
</VirtualHost>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question