Jump to content

[Solved] Index.php Is Showing 500 Internal Server Error


saikoscs

Recommended Posts

I was trying to port a php based CMD on my account in my public_html folder. But, every time I put index.php in the public_html folder, it throws 500 Internal Server Error.

index.html works just fine.

 

I checked that my index.php file has 0644 perm. and all the folder it needs access to, has 0755 perm. Even now it's not doing so.

 

I've put this line in my index.php, so it could show errors :

ini_set('display_errors', 1);

and this in my .htaccess :

php_flag display_errors 1

My .htaccess looks like :

 

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|content|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]
php_flag display_errors 1

 

 

Not sure what's causing this weird problem. I have checked the website and it's working on my local system. Here's the github repo of the project : https://github.com/chocolatkey/FoOlSlide2

 

Could anyone please look into this and help me?

 

Thank You

Link to comment
Share on other sites

So, you had 2 errors

  • public_html was 777. It needs to be 750. All of the folders inside public_html need to be 755, but public_html itself is special and needs to be 750.
  • .htaccess seems to have a syntax error of some sort. I didn't actually look at it. I just renamed it to .htaccess-old and the 500 error went away. So there is something in there it doesn't like. You can debug it by commenting out one line at a time or whatever.
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...