doufu3718 2015-07-04 15:15
浏览 71
已采纳

PHP文件中的500内部服务器错误

I have a problem. I installed CentOS Web Panel and varnish cache on my VPS server. I have two domains, two hosts on a VPS. One website is using WordPress other is not. 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). Just one file is working named testmail.php, which contains: <?php echo phpinfo(); ?> Here is apache error log:

[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). I've also noticed that there are no modules(mod_rewrite.so.. or any other) in second apache config file(used by server).

I tried to change ownership (chown) and tried to change file permissions (chmod) but nothing works. Can you help please?

  • 写回答

1条回答 默认 最新

  • douyan2470 2015-07-04 15:36
    关注

    500 Internal Server Error occurs from following reason. you can solve by followng:- 1.If you have not given file permsission you can get this error. Please give file permission.

    1. Or Open Apache’s httpd.conf file you have to find following lines, and remove #

      LoadModule rewrite_module modules/mod_rewrite.so

    LoadModule headers_module modules/mod_headers.so

    1. you can also check your htaccess is file or folder is allowed or not.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器