PHP not being interpreted on new domains after update

7 posts / 0 new
Last post
#1 Thu, 04/25/2013 - 05:33
Yourname

PHP not being interpreted on new domains after update

On April 23, I performed an update. Virtualmin showed new updates, and I updated.
Today, April 25, I added a few domains. After adding, I uploaded their contents and when I go to the index.php on the browser, it's a blank page.

The old PHP domains render well. Only the new ones aren't showing any PHP content.
I did a "locate php.ini" and each domain had the following:

/home/domain/etc/php.ini
/home/domain/etc/php5/php.ini

I suspected something and went to "Server Configuration" and clicked on "PHP Versions" only to see:
Your system only has PHP version 5 installed, so selecting a different version for each directory is not possible.

I checked "Webmin Actions Log" and it shows it updated PHP
yum -y update php

"System Settings" -> "Recheck Configuration" says:
The following PHP versions are available : 5.4.14 (/usr/bin/php-cgi)

What gives? Please help!! Thanks a lot for reading!
PHP execution is FCGId

Thu, 04/25/2013 - 08:29
andreychek

Howdy,

It looks like you're using a non-standard version of PHP... and sometimes those can cause some problems.

If you look in /etc/httpd/conf.d, are there any .conf files there that contain the word "SetHandler"? The entire line would probably look something like this:

SetHandler application/x-httpd-php

Some non-standard PHP packages install a .conf file in that directory which globally enables mod_php, regardless of what the individual settings of each domain are.

If you find a .conf file with that setting, just comment out the "SetHandler" lines in it, and restart Apache.

-Eric

Thu, 04/25/2013 - 22:39
Yourname

On April 12, looks like php.conf in that directory added this:

#
<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

I commented out the SetHandler, and it works now! Thanks so much.

But I must wonder, I have never installed anything on that server other than Virtualmin - and Virtualmin was the only one updating these packages. So how is it that a non-standard version of PHP gets installed by Virtualmin?

Fri, 04/26/2013 - 07:18
andreychek

Howdy,

A non-standard PHP version would only get installed if a third party repository had been enabled on your system.

During the Virtualmin installation process, something like "yum install php" is run.

On a fresh version of a distro, with no third party repositories enabled, that would install the distro vendors version of PHP (which is what we recommend).

However, if someone had enabled a third party repository such as REMI on your system, that would cause yum to install PHP from that third party repository, since it contains a newer PHP version.

You can see the repositories that are enabled by looking in /etc/yum.repos.d.

-Eric

Mon, 04/29/2013 - 05:50
Yourname

Andreycheck, thanks so much again! Yes, the repos were enabled. Disabled them now! Hopefully this doesn't happen again!

Mon, 04/29/2013 - 07:31
andreychek

Super, I'm glad that helped!

-Eric

Thu, 08/11/2016 - 15:55
TheBumpaster

I faced this problem myself while installing virtualmin, and actually it came along because I had to manually install every required server specially mysql server... the problem is in a missing package libapache2-mod-php5 , after installing it helped...

apt-get update

apt-get install php5 libapache-mod-php5 php5-mysql

apt-get -f install

apt-get autoremove

this helped me out :D

-Ismar

Topic locked