system
1
How to enable php error log, especially when using production php?
Sometimes there is some programming errors which cause 500 errors. But cannot see the reason anywhere.
I know the ini_set could work but I would like to set it globally for all php pages.
Hello,
In your OVH customer panel, navigate to Web Cloud > Hosting > and set your PHP environment in "Development" mode.
Doing so, the 500 error messages text should be displayed when they occur.
system
3
Unfortunatelly that is not a suitable answer.
- I would like to have it in the production mode, without revealing any internal errors to everyone.
- I don't see the output since it is called by 3rd party application. So a log file is really the only good option.
system
4
Development mode cannot be a solution if we need to monitor and solve production web pages.
Besides it is not good idea to reveal internal errors to all users.
Also, certain pages are called by 3rd party applications and we cannot see the output of the page.
system
6
ini_set works but it would require adding it everywhere.
Not a solution I was looking for.
Quite amazing if OVH does not have any easy way to set these configurations globally..
system
7
The solution was simpler than I though:
Just add a .user.ini file to the www folder. At least error_log setting seems to be effective then everywhere.
system
9
A better explanation to help the others:
www/.user.ini
log_errors=1
error_log=${DOCUMENT_ROOT}/../php-errors.log
error_reports=E_ALL
system
10
You can enable PHP error logging by editing your php.ini file and setting:
log_errors = On
error_log = /path/to/error.log
display_errors = Off
Then restart your server.
https://mylattecoffee.com/