Apache & php 500 error nightmares

I tried to add php support on VPS, and after logging in and trying to upgrade php, my site gives me 500 errors every time I try to access it.

So, I tried updating apache install with easyApache, and it went smoothly beyond the fact that php scripts still don't work.

I decided there should be something in the php syntax, so I tail -f'd / etc / httpd / logs / error_log and tried to go to the site, and of course it seems that something is wrong with the headers .

Here is what the error log generates in 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

As far as I can tell, the "Bad header" is always equal to the first line of the php script.

Unfortunately, after that I am super, I have never encountered such problems, and although I know my way around unix, I am not a server administrator.

I suppose this might be a serverfault question, but I suppose this is the type that developers are more likely to encounter, so you guys can help.

+3
source share
1 answer

It seems you have upgraded from PHP <5.2.3 to PHP> = 5.2.3. In the PHP 5.2.3 summary, you can read:

Changed the purpose of installing CGI for php-cgi and "make install" to install the CLI when CGI is selected.

You need to use the php-cgi binary, not the php binary.

In your Apache configuration, check the following line:

Action application/x-httpd-php /usr/bin/php-cgi

If it points to the binary / usr / bin / php, specify it in php-cgi.

+3
source

Source: https://habr.com/ru/post/1750763/


All Articles