500 internal server error on installing slim framework
Pergunta
i am developing a simple RESTful API on slim framework. I had no problem installing the slim framework on my local wamp server and it works just fine, but as I do the same on my website I get an 500 internal server error.
My httaccess file
RewriteEngine On
RewriteBase /slim/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
php_flag register_globals on
I need help, could someone please enlighten me on how to fix this problem?
Solução
If your web host is a CPanel one (a pretty good chance), it's probably using SuPHP in which case any php_flag
or php_value
directives in .htaccess
will trigger a 500 error.
See http://blog.philipbrown.id.au/2009/08/php-suexec-and-custom-php-ini-files/
register_globals
is a terrible hack and one you definitely should not be using. If the framework requires it, choose a better framework.
Update
The syntax on line #40 is using a PHP 5.3 anonymous function. Your web host is probably using a lower PHP version.
See the advice under Step 3: Define Routes section on this page.
Outras dicas
I encountered the same problem and I was able to correct this by uncommenting the following line in the file "httpd.conf" (apache conf) :
#LoadModule rewrite_module modules/mod_rewrite.so
Maybe this indication will help someone later ;)