PDA

View Full Version : VPS: PHP only works in some directories



akreider2
07-08-2009, 03:17 PM
PHP only works in some directories on my (Centos) VPS.

When it doesn't work, it gives me the Apache "Internal Server Error" page.

PHP 5.2.5
Apache 1.3.41

I have a test.php file that does echo "test". It has permissions 0755.

It works in my public_html/map/ subdirectory (0755). But doesn't
work in the main public_html directory (0755).

Both directories have the same php.ini file.

The server is not hitting any resource limits.

The .htacces file isn't the problem (removing it didn't improve matters).

What could the problem be?

akreider2
07-08-2009, 03:31 PM
Apache Errors

[Wed Jul 8 17:30:39 2009] [error] [client 76.124.91.0] Premature end of script headers: /home/energy/public_html/map-test/phpinfo.php

SoftException in Application.cpp:357: UID of script "/home/energy/public_html/map-test/phpinfo.php" is smaller than min_uid

akreider2
07-08-2009, 03:33 PM
I think the problem is that I'm uploading files as "root". So root owns them. And then I run php using suphp.

So I need to stop logging in to ftp with the root account. Yes, that works!

Ron
07-08-2009, 04:37 PM
Glad we helped :D :D :D

jason
07-10-2009, 02:38 PM
I assume that you are running suPHP (i.e. standard cPanel php chi install) and that that is I believe is running in "paranoid" mode. With that setup, suPHP will only allow a php script to run if the owner matches the the user id specified in the apache setup, which will be that of the "siteusr" owner. So if your site username is site and the php file is owned by root, siteusr != root, so the check fails, and no php for you!

--Jason