[SOLVED] Internal Server Error (PHP?)

7 posts / 0 new
Last post
#1 Sat, 01/14/2017 - 12:41

[SOLVED] Internal Server Error (PHP?)

I've created a virtual server and installed Wordpress onto it.

But I'm getting "500 internal server error" and, looking at the error logs, it says:

(104)Connection reset by peer: [client] mod_fcgid: error reading data from FastCGI server

[client] End of script output before headers: index.php

I am assuming that this relates to PHP in some fashion, as that's what these errors indicate, but I'm not sure quite what exactly's wrong here. Googling the problem suggests this might have something to do with suexec and file permissions, perhaps.

Can anyone please assist me with this?

Sat, 01/14/2017 - 12:59

Addendum: I tried changing all the file permissions to 0750 (as that appears to be the default value in the server settings page, so I thought that'd be the one to try first).

Now it's saying "access denied" and the error log is "mod_fcgid: stderr: PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0".

So it does appear to be a file permissions thing, albeit that 0750 clearly isn't right. With suexec, isn't the PHP being run with the virtual server owner's user account, so why isn't the "7" in 750 good enough, as surely that grants the owner full permissions?

Sat, 01/14/2017 - 18:46
Diabolico's picture

Revert all changes with file permissions (seriously do it!) and then check if the owner/group of each file/folder match the Virtual server owner. I suspect you uploaded the files as root and now owner/group is set to root/root instead of VS_owner/VS_owner.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Sun, 01/15/2017 - 00:22 (Reply to #3)

Ah, yes. Should have thought of that. Uploaded as my admin user rather than "root:root" but essentially the same problem.

Wordpress is now up and running.

Thanks a bunch.

Sun, 01/15/2017 - 00:04


Yeah you may want to ensure that all your files/folders are owned as the Virtual Server owner. One way to reset the permissions is by going into Limits and Validation -> Validate Virtual Servers -> Fix Permissions.

Once the permissions are correct, if you still aren't seeing anything helpful in the Apache logs -- try going into Server Configuration -> Website Options, and change the PHP Execution Mode to "CGI". It tends to produce better errors than FCGID, and may offer more helpful messages in your error log.


Sun, 01/15/2017 - 00:27 (Reply to #5)

It was the file permissions. Copied and extracted the files as the admin user so, of course, they were owned by the admin, not the virtual server owner. D'oh!

But thanks for the pointer to the "Fix Permissions". I just fixed it manually via the shell, but if there's actually a button in Virtualmin that I can press that sorts it out for me, I'll rather be using that, as that sounds far simpler.

Thanks for the tips.

Wed, 05/23/2018 - 11:15

same frustrating problem here - but oddly enough, restarting apache fixed it for me. very strange!

Topic locked