ovhconfig and PHP error display

Hello

I am having trouble with displaying PHP errors.

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.

My .ovhconfig:

environment=development
container.image=stable64
app.engine=php
http.firewall=none
app.engine.version=8.2

In www, there is a one‑line .htaccess:

Options -Indexes

What am I doing wrong?

Thanks for your help.

Hello @autre_luc

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?
  • Which site is affected?

Astérix

Hello @autre_luc

Could you give us the name of your domain?

Could you install the bonjour.php script and thereby check the actual PHP version seen on your site?

Could you rename all .ovhconfig files in /www and below to .ovhconfig_OLD

See in my guide the paragraph: [I3 – SSL Check: With the bonjour.php script](https://wordetweb.com/word-et-web/WORDPRESS-guide-installation-de-WordPress-premier-domaine-chez-OVH-FR.htm#_I3_–_Contrôle “I3- SSL Check: With the bonjour.php script”)

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.

Switch to Development Environment.

See the paragraph in my guide: P2 - Error 500 - Development Environment

Okay: problem solved.

@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??

Can you rename all the .ovhconfig files in /www and underneath to .ovhconfig_OLD

And only use the OVH manager to manage the PHP version.

Yes, the simplest and safest is probably to go through the OVH manager. That’s what I’ll do.