• Markuswp

    (@markuswp)


    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

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

    @ini_set('display_errors','Off');
    @ini_set('error_reporting',0);

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

    Thread Starter Markuswp

    (@markuswp)

    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.

    ravimallya

    (@ravimallya)

    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

    Thread Starter Markuswp

    (@markuswp)

    Hi ravimallya,

    Thank you for replying.

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

    ravimallya

    (@ravimallya)

    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:

    <?php
    phpinfo();
    ?>

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘HowTo disable PHP errors using htaccess on a shared hosting’ is closed to new replies.