Submitted by sgrayban on Thu, 06/30/2011 - 15:10
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
Submitted by JamieCameron on Thu, 06/30/2011 - 16:07 Comment #1
That file isn't supplied by Virtualmin though .. I would expect that your new PHP 5.3 package would include a corrected SetHandler line.
Submitted by sgrayban on Thu, 06/30/2011 - 17:37 Comment #2
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>
Submitted by sgrayban on Thu, 06/30/2011 - 17:39 Comment #3
Another thing I am debugging is that fcgid does not work with 5.3 either with your default directives either.
Submitted by JamieCameron on Thu, 06/30/2011 - 17:55 Comment #4
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?Submitted by sgrayban on Thu, 06/30/2011 - 20:00 Comment #5
This client was a migration to VM last year that's why it wasn't commented out.
Submitted by sgrayban on Thu, 06/30/2011 - 22:31 Comment #6
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.
Submitted by JamieCameron on Thu, 06/30/2011 - 23:29 Comment #7
If the package is overwriting a configuration file that has been modified, that seems like a bug in the package..
Submitted by sgrayban on Fri, 07/01/2011 - 12:34 Comment #8
Ok I am verifying this with Guillaume Plessis.
Submitted by sgrayban on Fri, 07/01/2011 - 14:04 Comment #9
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 ?
Submitted by JamieCameron on Fri, 07/01/2011 - 15:34 Comment #10
When you install Virtualmin using our script, it installs the
virtualmin-base
package which haslibapache2-mod-fcgid
as a dependency. Later on it editsphp5.cgi
to remove theSetHandler
line.What is in that
/etc/apache2/mods-enabled/fcgid.conf
file that needs to be modified though?Submitted by sgrayban on Sat, 07/02/2011 - 01:40 Comment #11
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
Submitted by JamieCameron on Sat, 07/02/2011 - 18:59 Comment #12
I can't see how that AddHandler line would cause issues .. if you remove just that line, does it fix the problem?
Submitted by sgrayban on Sat, 07/02/2011 - 19:00 Comment #13
Yes at least for php 5.3 it did.
Submitted by JamieCameron on Sun, 07/03/2011 - 00:10 Comment #14
Any idea why? In my tests, adding that directive to my apache config manually had no effect ..
Submitted by sgrayban on Sun, 07/03/2011 - 00:18 Comment #15
are you using the dotdeb packages ?
Submitted by JamieCameron on Sun, 07/03/2011 - 12:16 Comment #16
No .. But if the error is in the AddHandler directive, I would expect it to be independent of the PHP version...
Submitted by sgrayban on Tue, 07/05/2011 - 16:17 Comment #17
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.
Submitted by JamieCameron on Tue, 07/05/2011 - 16:21 Comment #18
When you have that line in, what is the exact error message or incorrect behavior that you are seeing?
Submitted by sgrayban on Tue, 07/05/2011 - 16:23 Comment #19
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.
Submitted by sgrayban on Tue, 07/05/2011 - 16:36 Comment #20
Opps I don't get a blank page... I meant to say it tries to download the php file.
Submitted by bleck on Mon, 09/15/2014 - 09:52 Comment #21
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.