CentOS PHP upgraded, now downloads all pages

I had to upgrade PHP to 5.6 to get access to a new function for locales and translation. I removed the old PHP and added the new PHP from the Remi repo as specified here.

I restarted Apache and now going to any page on the server prompts for download. I searched extensively, and PHP 5 is loaded as a module:

<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
</IfModule>

<IfModule !prefork.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

The configtest does also return php5_module (shared). I’ve also tried many handlers and AddTypes, this is one I have in currently in httpd.conf:

AddType  application/x-httpd-php         .php
AddType  application/x-httpd-php-source  .phps

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

So why doesn’t Apache serve the PHP files?

EDIT:

I ran the following commands:

yum remove php-common

Then installed php5.6 exactly the way the link described.

Then updated the httpd.conf with the second code block with the AddType and SetHandler.

This was all I did.

EDIT:

php-common-5.6.16-1.el7.remi.x86_64
php-mysqlnd-5.6.16-1.el7.remi.x86_64
php-dba-5.6.16-1.el7.remi.x86_64
php-pecl-zip-1.13.1-1.el7.remi.5.6.x86_64
php-5.6.16-1.el7.remi.x86_64
php-cli-5.6.16-1.el7.remi.x86_64
php-mcrypt-5.6.16-1.el7.remi.x86_64
wbm-php-pear-1.5-1.noarch
php-pecl-jsonc-1.3.9-1.el7.remi.5.6.x86_64
php-pdo-5.6.16-1.el7.remi.x86_64
php-gd-5.6.16-1.el7.remi.x86_64

is the result of rpm -qa '*php*'

Answer

Attribution
Source : Link , Question Author : ashraj98 , Answer Author : Community

Leave a Comment