简体   繁体   English

PHP文件中的500 Internal Server Error

[英]500 Internal Server Error in PHP files

I have a problem. 我有个问题。 I installed CentOS Web Panel and varnish cache on my VPS server. 我在VPS服务器上安装了CentOS Web面板和清漆缓存。 I have two domains, two hosts on a VPS. 我有两个域,一个VPS上有两个主机。 One website is using WordPress other is not. 一个网站正在使用WordPress,其他网站则没有。 Now everything on non-wordpress site is working (html,js,css,picture files...) fine except that PHP files are not working now(Same on WordPress). 现在,非WordPress网站上的所有内容都可以正常运行(html,js,css,图片文件...),但PHP文件现在无法正常工作(与WordPress相同)。 Just one file is working named testmail.php , which contains: <?php echo phpinfo(); ?> 只有一个文件正在运行,名为testmail.php ,其中包含: <?php echo phpinfo(); ?> testmail.php <?php echo phpinfo(); ?> Here is apache error log: <?php echo phpinfo(); ?>下面是Apache的错误日志:

[Sat Jul 04 16:29:29 2015] [error] [client 172.***.***.***] Premature end of script headers: testip.php
[Sat Jul 04 16:29:37 2015] [notice] caught SIGTERM, shutting down
[Sat Jul 04 16:29:39 2015] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Jul 04 16:29:39 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Sat Jul 04 16:29:40 2015] [notice] Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips configured -- resuming normal operations
[Sat Jul 04 16:42:07 2015] [notice] caught SIGTERM, shutting down
[Sat Jul 04 16:42:21 2015] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Jul 04 16:42:21 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Sat Jul 04 16:42:22 2015] [notice] Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips configured -- resuming normal operations

I've noticed that i have two php.ini files one is at /etc/php.ini other is at /usr/local/php/php.ini (used by server) and I also have two httpd.conf files one is at /etc/httpd/conf/httpd.conf other is at /usr/local/apache/conf/httpd.conf (used by server). 我注意到我有两个php.ini文件,一个位于/etc/php.ini另一个位于/usr/local/php/php.ini (由服务器使用),我还有两个httpd.conf文件,一个是/etc/httpd/conf/httpd.conf其他位置位于/usr/local/apache/conf/httpd.conf (由服务器使用)。 I've also noticed that there are no modules( mod_rewrite.so .. or any other) in second apache config file(used by server). 我还注意到第二个apache配置文件(服务器使用)中没有模块( mod_rewrite.so ..或任何其他模块)。

I tried to change ownership (chown) and tried to change file permissions (chmod) but nothing works. 我尝试更改所有权(chown)并尝试更改文件许可权(chmod),但没有任何效果。 Can you help please? 你能帮忙吗?

500 Internal Server Error occurs from following reason. 由于以下原因而发生500 Internal Server Error。 you can solve by followng:- 1.If you have not given file permsission you can get this error. 您可以通过以下方法解决:-1.如果未提供文件权限,则会出现此错误。 Please give file permission. 请授予文件权限。

  1. Or Open Apache's httpd.conf file you have to find following lines, and remove # 或打开Apache的httpd.conf文件,您必须找到以下几行,并删除#

    LoadModule rewrite_module modules/mod_rewrite.so LoadModule rewrite_module模块/mod_rewrite.so

LoadModule headers_module modules/mod_headers.so LoadModule headers_module modules / mod_headers.so

  1. you can also check your htaccess is file or folder is allowed or not. 您还可以检查htaccess是否允许文件或文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM