Dotdeb php packages php5 conf error

I just upgraded a client that wanted php 5.3x and ran into a small issue with apache2 php5.conf

File is /etc/apache2/mods-enabled/php5.conf

In PHP 5.2 and below versions that config file has..

SetHandler application/x-httpd-php

Which was just fine because the apache2 php mod allowed that directive however 5.3 and above this is depreciated now and that directive must be changed to

SetHandler application/x-httpd-php5

This conf change is for both lenny and squeeze. Users that use the dotdeb repo's need to make a note of this.

Status: 
Active

Comments

That file isn't supplied by Virtualmin though .. I would expect that your new PHP 5.3 package would include a corrected SetHandler line.

I understand that but the default is

SetHandler application/x-httpd-php

Not

SetHandler application/x-httpd-php5

which is what your script sets the handler to and will not work in php 5.3 now.

<Directory /home/noscarab/public_html>
Options Indexes IncludesNOEXEC FollowSymLinks +ExecCGI
allow from all
AllowOverride All
Action application/x-httpd-php5 /cgi-bin/php5.cgi
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php
</Directory>

Another thing I am debugging is that fcgid does not work with 5.3 either with your default directives either.

Actually, the Virtualmin install script should be commenting out the SetHandler lines in /etc/apache2/mods-enabled/php5.conf as they cannot be over-ridden in each domain's <Virtualhost> block ..

Did you install Virtualmin after php5.conf was created?

This client was a migration to VM last year that's why it wasn't commented out.

uhh I just checked other servers that are using the default 5.2 php versions and it looks like both those files are being overwritten when there is a upgrade for php/libapache2-mod-php5 and/or libapache2-mod-fcgid

I don't think that's good thing if they are suppose to be modified by VM during install.

If the package is overwriting a configuration file that has been modified, that seems like a bug in the package..

Ok I am verifying this with Guillaume Plessis.

Ok I found another bug that isn't related to the dotdeb packages but it is related to the modified conf files that VM does.

It looks like libapache2-mod-fcgid isn't installed by default and if you do install it /etc/apache2/mods-enabled/fcgid.conf is obviously not edited.

Are you seeing this also in debian ?

When you install Virtualmin using our script, it installs the virtualmin-base package which has libapache2-mod-fcgid as a dependency. Later on it edits php5.cgi to remove the SetHandler line.

What is in that /etc/apache2/mods-enabled/fcgid.conf file that needs to be modified though?

That file contains

<IfModule mod_fcgid.c>
#  AddHandler   fcgid-script .fcgi
#  FcgidConnectTimeout 20
</IfModule>

Its the same thing with the php5.conf --- if you have anything in that file it will not work for virtual hosts so I commented it out and php 5.3 worked using fcgid

I can't see how that AddHandler line would cause issues .. if you remove just that line, does it fix the problem?

Yes at least for php 5.3 it did.

Any idea why? In my tests, adding that directive to my apache config manually had no effect ..

are you using the dotdeb packages ?

No .. But if the error is in the AddHandler directive, I would expect it to be independent of the PHP version...

I just tested this on a new virtual server and when I installed the dotdeb php5.3 package it did the same thing and if I comment out the AddHandler line fcgid works.

I wonder what the difference is with the 5.3 version you tested on.

When you have that line in, what is the exact error message or incorrect behavior that you are seeing?

I don't get a error at all even when the apache logging is set to debug and php to log everything. All I get is a blank page.

Opps I don't get a blank page... I meant to say it tries to download the php file.

I've update PHP via dotdeb repositories on my server where Virtualmin was already installed and running. I got the blank page and download pop-up result.

Commenting the handler directives in 2 configuration files in the directory /etc/apache2/mods-available/ solved the problem.

fcgid.conf :

<IfModule mod_fcgid.c>
#  AddHandler fcgid-script .fcgi
#  FcgidConnectTimeout 20
</IfModule>

php5_cgi.conf:


<FilesMatch ".+\.ph(p[345]?|t|tml)$">
#    SetHandler application/x-httpd-php
</FilesMatch>

Configuration : Virtualmin 4.10 gpl, Debian 6 Squeeze, upgrading to PHP 5.4.32-1~dotdeb.0.