无法运行任何PHP

我运行一个相当受欢迎的网站(我不是想吹牛,但是我有两万个用户需要访问,我不想再让他们等待),而且我已经停下了将近一个月的时间,而我试图find出了什么问题。 基本上,我不能运行任何PHP。 这一切都发生在我们把我的账户转到CPanel之后,所以我可以在没有我的networkingpipe理员的帮助下自己pipe理事情。 我喜欢有CPanel访问,但我不能运行任何PHP。

我重新上传了网站,恢复了1.3TB数据库,创build了新的子域名,更改了所有权,固定的权限,使CPanel中的所有内容都变得完美。 不过,运行该网站时,我只能得到一个500错误。 没有PHP的作品,甚至没有一个简单的回声。

我做了新的.php文件,并尝试,仍然没有去。 当我在WAMP和XAMPP中运行站点时,它工作正常(我猜)我没有看到站点,它只是抱怨找不到数据库,因为$ databasevariables是为localhost设置的。

我的网站pipe理员和我已经尝试了一切。 HTML工作正常。 我几乎卡在这里。 如果你想看到自己的500错误:capecraft.capturedhdtv.com/capes/site/demo.php。

任何解决scheme将非常赞赏。 此外,我们已经尝试删除.htaccess的东西。

另外,我的日志告诉我绝对没有。 FTP中的error_log告诉我在安装过程中我很久以前犯的错误,比如404.shtml不存在,因为我忘了复制它。 cPanel中的错误日志告诉我没有任何关于我的问题。 文件如何不存在,人们正试图访问,例如一个图片是不是在服务器上(不涉及所有网站)

CPanel日志:在哪里你看到.png和一个缺less的IP,或目录的一部分,我出于安全目的删除它。

[Fri Feb 24 03:35:14 2012] [error] [client ] File does not exist: /home//public_html/capes2/404.shtml [Fri Feb 24 03:35:14 2012] [error] [client ] File does not exist: /home//public_html/capes2/.png [Fri Feb 24 03:35:13 2012] [error] [client ] File does not exist: /home//public_html/capes2/404.shtml [Fri Feb 24 03:35:13 2012] [error] [client ] File does not exist: /home//public_html/capes2/.png [Fri Feb 24 03:35:10 2012] [error] [client ] File does not exist: /home//public_html/500.shtml [Fri Feb 24 03:35:10 2012] [error] [client ] SoftException in Application.cpp:357: UID of script "/home//public_html/capes/site/sup/tests/action-acceptance.php" is smaller than min_uid [Fri Feb 24 03:35:09 2012] [error] [client ] File does not exist: /home//public_html/capes2/404.shtml [Fri Feb 24 03:35:09 2012] [error] [client ] File does not exist: /home//public_html/capes2/.png [Fri Feb 24 03:35:09 2012] [error] [client ] File does not exist: /home//public_html/capes2/404.shtml [Fri Feb 24 03:35:09 2012] [error] [client ] File does not exist: /home//public_html/capes2/.png [Fri Feb 24 03:35:06 2012] [error] [client ] File does not exist: /home//public_html/capes2/404.shtml [Fri Feb 24 03:35:06 2012] [error] [client ] File does not exist: /home//public_html/capes2/J.png [Fri Feb 24 03:35:01 2012] [error] [client ] File does not exist: /home//public_html/capes2/404.shtml [Fri Feb 24 03:35:01 2012] [error] [client ] File does not exist: /home//public_html/capes2/.png [Fri Feb 24 03:34:57 2012] [error] [client ] File does not exist: /home//public_html/capes2/404.shtml 

说实话? 雇用人来pipe理你的服务器。 如果你有一个1.3 TB的数据库,cPanel不适合你。 考虑到大量的数据,你将需要一个相当优化的MySQL服务器,以获得可接受的性能。 cPanel对于非常大的网站来说并不是很理想(它严重限制了您可以更改的服务器端设置的数量,而不会破坏其他的东西)。

但是,您的实际问题可能是文件权限。 cPanelconfigurationPHP的方式是在权限过于开放的情况下不能运行(这在cPaneldevise的共享服务器上是完全合理的)。 CHMOD你所有的文件到644和所有的目录到755(见http://djlab.com/2009/06/cpanel-suphp-chmod-all-files-644-and-all-folders-755/

你的whm有一个叫做minimum uid的默认值为500的设置,而在linux中,每一个用户都有一个唯一的号码叫做uid,一旦你创build了一个帐号来使用cPanel例如,这个帐号的uid值是500,下一次会是设置为501等等。 对于任何用户,你可以使用这个ssh命令来检查用户的uid:

 id -u username 

出于安全原因,configurationApache服务器不执行任何PHP脚本在一个文件中有一个小于最小uid女巫的uid的所有者在whm设置为500。

所以如果你使用root用户上传你的站点文件使用scp / ftp例如所有这些文件所有权都设置为root ,所以检查这个用户uid是否小于500(默认情况下btw 用户uid是0)更改所有者uid到超过500使用这个ssh命令:

 usermod -u 1000 username 

或使用此ssh命令将文件所有权更改为另一个用户:

  chown -R username:username /home/username/public_html/ 

首先检查PHP解释器是否正常工作的一种简单方法是在命令行上运行它,

 php yourphpscript.php 

如果上面的命令抛出脚本的输出,那么几乎证实你的PHP解释器工作正常。

其次,内部服务器错误肯定会被logging到Apache error_log中。 您提供的代码片段似乎并不指示内部服务器错误的任何实例。

更好的方法是使用-f选项运行尾部以跟踪日志文件,然后访问您的网站URL。 任何被logging的错误/消息都会显示在屏幕上,

 tail -f /path/to/apache/error_log 

由于.htaccess中的input错误,也可能发生500内部服务器错误。