阿帕奇& PHP 500错误的噩梦 [英] apache & php 500 error nightmares
问题描述
我试图在VPS上向php添加curl支持,并且登录并尝试执行php升级后,每次尝试访问它时,我的网站都会给我500错误.
I was trying to add curl support to php on a VPS, and after logging in and trying to perform a php upgrade, my site gives me a 500 error every time I try to access it.
因此,我尝试使用easyApache刷新apache的安装,但是它超出了php脚本仍然无法正常工作的范围.
So, I tried refreshing apache install with easyApache, and it went swimmingly outside of the fact that php scripts still didn't work.
我认为php解析必须进行一些操作,因此我拖尾了-f'd/etc/httpd/logs/error_log并尝试导航到该站点,并且可以肯定的是,标题似乎有问题
I decided there must be something going on with php parsing, so I tail -f'd /etc/httpd/logs/error_log and tried navigating to the site, and sure enough, it looks like there's something wrong with the headers.
这是在所有php文件请求中生成的错误日志:
Here's what the error log is generating on all php file requests:
[Fri Jun 18 20:01:47 2010] [error] [client 00.00.00.00] malformed header from script. Bad header=<head> : index.php
据我所知,错误标头"始终等于php脚本的第一行.
As far as I can tell, the "Bad header" always equals the first line of the php script.
不幸的是,在这之后我感到非常困惑,我从未遇到过这样的问题,尽管我知道我在unix方面的工作方式,但我不是服务器管理员.
Unfortunately, I'm super stumped after this, I've never run into issues like this, and although I know my way around unix, I'm no server admin.
我想这可能是服务器故障的问题,但是我认为这是开发人员更可能遇到的问题,所以你们也许可以提供帮助.
I suppose this could be a serverfault question, but I figure this is the type of thing developers are more likely to run into, so you guys might be able to help.
推荐答案
似乎您已经从PHP升级了< 5.2.3至PHP> = 5.2.3. 在PHP 5.2.3更新日志中,您可以阅读:
It seems you've upgraded from PHP < 5.2.3 to PHP >= 5.2.3. In the PHP 5.2.3 changelog, you can read:
将CGI安装目标更改为php-cgi 和"make install"以在以下情况下安装CLI 选择了CGI.
Changed CGI install target to php-cgi and 'make install' to install CLI when CGI is selected.
您需要使用php-cgi二进制文件而不是php二进制文件.
You need to use the php-cgi binary and not the php binary.
在您的Apache配置中,检查以下行:
In your Apache configuration, check the following line:
Action application/x-httpd-php /usr/bin/php-cgi
如果它指向/usr/bin/php二进制文件,请将其指向php-cgi.
If it's pointing to the /usr/bin/php binary, point it to php-cgi.
这篇关于阿帕奇& PHP 500错误的噩梦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!