HowTo disable PHP errors using htaccess on a shared hosting (6 posts)

  1. Markuswp
    Posted 3 years ago #

    Hi wp fans

    I am trying to disable PHP errors using the .htaccess file. I am on a shared hosting provider. Currently I am using this code:

    php_flag display_errors off
    php_value error_reporting 0

    but I get "Internal Server Error" message.

    The thing is that I use this code on my local server (apache) and it works just fine. But on the shared host I get that message.

    Is there any other way to disable those PHP errors under a shared host or is there any other code to use ?

    I will greatly appreciate your response and I thank you in advance.

  2. Try this in your wp-config.php file (back up that file first):


    If that doesn't work, undo those changes and ask your hosting how to disable errors.

  3. Markuswp
    Posted 3 years ago #

    Hi Jan Dembowski,

    Thank you for your fast response. I tried that also and unfortunately it does not work either.

    I guess it is up to the hosting provider on how to disable those errors.

    Bit of frustrating though.

  4. ravimallya
    Posted 3 years ago #

    try to disable display errors in php.ini file. Some of the shared hosting servers run PHP as CGI module, where .htaccess php_flags won't work fine. Some of hosting servers have their own php.ini file for each and every accounts they have, go to it, and edit; otherwise, create a custom php.ini file where you wish to set display errors off with following code:

    display_errors = Off
    error_reporting = 0
  5. Markuswp
    Posted 3 years ago #

    Hi ravimallya,

    Thank you for replying.

    I tried that also with no luck. Unfortunately neither php.ini or .htaccess works on some hosting providers.

  6. ravimallya
    Posted 3 years ago #

    Where you hosted your website, Markuswp? Whether you're using cPanel? Can I have a page link to phpinfo(); function? You can create a test PHP file with following code and provide me with exact url of that file from your domain:


    You're most welcome. I'm bit interested in Unix and WordPress.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.