If I understand correctly, errors are displayed when the environment parameter is set to “environment=development” and are not displayed when it is set to “environment=production”. This is in the ovhconfig file placed at the same level as www.
However, when I change this parameter (to production), it does not seem to be taken into account. Errors remain visible.
I invite you to check for the presence of multiple .ovhconfig files within your hosting; this can generate conflicts if you are using several incompatible versions together.
The development mode is very useful, because instead of displaying a blank page when an error occurs, an error code will be shown.
The “Options -Indexes” directive present in your .htaccess file prevents visitors to your site from listing the contents of directories in your hosting.
Regarding the errors you are encountering:
What are these errors?
What do your hosting logs say at the moment these errors appear? (web logs and error logs)
Did these errors appear after a modification you made on your site?
Hello and thank you for taking the time to answer me.
To try to answer your questions.
PHP version 8.2.29
There is only one .ovhconfig in my directory tree.
I am well aware of the usefulness of displaying errors; I used it while developing locally. But I want that once my site is truly accessible, those errors are no longer displayed. Even though, of course, I try to make sure none remain.
The errors in question. It is a PHP code developed on my local computer. The display of errors there was controlled by a “php_flag display_errors On or Off”. This does not work on my OVH hosting, hence the idea to control it with “environment=production” in .ovhconfig. It’s not the errors that worry me but their possible display.
After multiple attempts, I still have the impression that the changes I make in .ovhconfig are taken into account but only after a delay of about an hour. That seems odd, but maybe that’s all…
The site in question is not publicly accessible yet because I want to be completely sure it works properly before opening it.
@Gaston I had already gone through part of your guide. Thanks for this massive work! But I hadn’t read the relevant section.
So: the procedure described in that guide does indeed toggle the PHP error display mode. The changes on the hosting/configuration page → global PHP version actually modify the .ovhconfig file.
The only mystery left (and it only concerns me) is that the changes are the same as those I think I made manually, yet they don’t work. Typo? File modified locally but not uploaded? Order of lines in .ovhconfig??