Quantcast
Channel: Richard Knop » Uncategorized
Viewing all articles
Browse latest Browse all 10

500 Internal Server Error

$
0
0

I have recently switched web hosting provider and had to move my personal website and blog over to the new one. I have encountered a simple problem when trying to get my personal website to work (it’s a Zend Framework application). I got the 500 Internal Server Error:

500 Internal Server Error

The problem lied in this .htaccess rule:

php_flag magic_quotes_gpc off

So I just commented the line and the error went away.

The line’s purpose was to make sure magic quotes are turned off in PHP.  You can use it if your web host supports it, if not just add this to your bootstrap file:

protected function _initGetRidOfMagicQuotes()
{
    if (get_magic_quotes_gpc()) {
        function stripslashes_deep($value) {
            $value = is_array($value) ?
            array_map('stripslashes_deep', $value) :
            stripslashes($value);
            return $value;
        }

        $_POST = array_map('stripslashes_deep', $_POST);
        $_GET = array_map('stripslashes_deep', $_GET);
        $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
        $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
    }
}

Viewing all articles
Browse latest Browse all 10

Trending Articles