Upgraded to PHP 5.4, 500 internal server error

Hi all

I think I did a stupid thing. I upgraded my Squeeze box to PHP 5.4.40 and now none of my sites are working. I am getting an internal server error 500.

I tried adding:

AddHandler application/x-httpd-php5 .php AddHandler application/x-httpd-php .php4

to a sites .htaccess, but then the site just downloads the index page instead of displaying.

Has anyone come across this before? I am at a loss and google isn't much help. Right now I have about 15 sites with upset admins :/

Thanks

Status: 
Active

Comments

Howdy -- unfortunately there isn't a supported way to upgrade to PHP 5.4 on Debian 6. The only supported options would be to manually install a second PHP version, similar to how the "Multiple PHP" documentation describes for CentOS 6, or to upgrade/migrate to Debian 7.

That said, you could always try looking for any "SetHandler" lines that exist in the conf files in /etc/apache2/mods-enabled. It's possible that a newly added SetHandler line is breaking PHP apps... if you see one, I'd suggest commenting it out and restarting Apache.

So you're still seeing a problem after removing the SetHandler line(s)?

Do any errors show up in the Apache error logs in $HOME/logs/error_log?

Am back on 5.3.3.7

If anyone knows of a foolproof way to upgrade, I would appreciate it :D

sorry, logs were full of this . it is entirely possible that it would have worked had i installed the fcgi module through apt-get. i will try again tomorrow and see if it was something so stupid as a missing module.

[Sat May 09 19:55:02 2015] [warn] [client 178.238.225.144] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Sat May 09 19:55:02 2015] [error] [client 178.238.225.144] Premature end of script headers: index.php

A quick question, not 100% related. Is there any easy way to go from Squeeze to Jessie, or do I need to go to Wheezy first. Also, are there any particular pitfalls to watch out for from a Virtualmin perspective? perhaps a good guide to follow and make sure i dont miss anything.

Many thanks, as always, for any help.

Kind regards Dave

I suspect the issue wasn't FCGID, the error there would be different. FCGID can sometimes hide the actual error though. If you try it again, you might want to try setting the PHP Execution Mode to CGI, and see what error is thrown then.

Regarding upgrading Debian -- I believe you would need to perform two upgrades to get to Debian 8 from Debian 6.

We have instructions for performing those steps here:

https://www.virtualmin.com/documentation/system/os/debian-squeeze-to-whe...

https://www.virtualmin.com/documentation/system/os/debian-wheezy-to-jess...

If you wanted to hear from folks in the community how they handle PHP on Debian 6, you could always ask for some opinions in the Forums.

However, we personally recommend using packages provided by the vendor... and in that case, there isn't a good way to upgrade PHP while keeping Debian 6.