500 Internal Server Error with PHP file

1 like 0 dislike
asked Mar 11, 2016 in Website Issues by philip2013 (1,550 points)
Hello,

My PHP files all display a 500 Internal server error when I'm attempting to access PHP files through the temp-URL ****://serverName/~username/index.php

I try ****://serverName/~username/test.html with a basic HTML and it works correctly.

How can I fix this?

Thank you

2 Answers

1 like 0 dislike
answered Mar 11, 2016 by crishenderson (1,130 points)
selected Mar 11, 2016 by philip2013
 
Best answer
Hi Philip! It looks like a suPHP error. Ownership of the index.php does not match the domain owner.

As root, do a 'chown -R username:username /home/username/public_html'

See who users 500 and 506 are if you don't know. Check the /etc/passwd

cat /etc/passwd |grep 500
commented Mar 11, 2016 by philip2013 (1,550 points)
It's not yet working :(
commented Mar 11, 2016 by crishenderson (1,130 points)
After changing the ownership of all your files and folders inside the public_html you will again have to change the ownership only for the public_html folder to username:nobody.

Also make sure that you have also assigned the appropriate permissions to your folders and files.
commented Mar 11, 2016 by philip2013 (1,550 points)
Thank you! It's working now :)
0 like 0 dislike
answered Mar 11, 2016 by Jyson4u (750 points)
Are you with shared server or have root access on owned VPS or Dedicated server ?
commented Mar 11, 2016 by philip2013 (1,550 points)
I have my own dedicated server.
commented Mar 11, 2016 by philip2013 (1,550 points)
Here is additional detail

apache Log Error_Log

[error] [client xx.xx.xxx.xxx] SoftException in Application.cpp:422: Mismatch between target UID (506) and UID (500) of file "/home/myAccount/public_html/index.php"
[error] [client xx.xx.xxx.xxx] Premature end of script headers: index.php
[error] [client xx.xx.xxx.xxx] File does not exist: /home/myAccount/public_html/500.shtml

Related questions

Welcome to DNSBoot.com, where you can ask questions and receive answers from other members of the community.
...