Slim framework - 500 Internal Server Error

10,649

Solution 1

It is really a simple solution. RewriteBase must begin with a slash (/).
It must be the part of the url after the document root. In this case, I suppose it should be

RewriteBase /apiproject/

If your document root is /localhost, then RewriteBase must be /~username/apiproject/, but the first slash can not be absent.

Solution 2

I had the same problem in PHP 5.5.12, and the solution is to uncomment the following line in httpd.conf:

LoadModule rewrite_module modules/mod_rewrite.so
Share:
10,649

Related videos on Youtube

Sohrab Hejazi
Author by

Sohrab Hejazi

Software Engineer

Updated on June 20, 2022

Comments

  • Sohrab Hejazi
    Sohrab Hejazi almost 2 years

    There is probably a very simple solution to this but I can't seem to figure it out. I'm working a Slim Project which was working fine. I just did a fresh install of Yosemite on my system. I have installed MySQL and enabled PHP (5.5.20). I moved my Slim project under localhost/~username/apiproject.

    I get a '500 Internal Server Error' when I try to access my project. I have tried putting a simple html file in the same folder and accessing it via the browser and still get the same error on the HTML file. This tells me that the browser isn't able to access this folder.

    Next I tried removing the .htaccess file from the root of the project. When I did that, I was able to access the HTML page which I placed in the folder. However, I am not able to access the project.

    I'm assuming this has to be related to my Apache setting or my .htaccess file. I have also enabled mod_rewrite in my Apache settings. Here is what is in my .htaccess file:

    RewriteEngine On
    RewriteBase localhost/~username/apiproject
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [QSA,L]