1

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*'

ashraj98
  • 163
  • 2
  • 8
  • The only thing I see which may be applicable is `[Sun Nov 22 03:41:06.763977 2015] [mpm_prefork:notice] [pid 7002] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 PHP/5.4.16 SVN/1.7.14 configured -- resuming normal operations ` So it says PHP 5.4.16 is configured, but I removed it... How do I configure PHP 5.6 because I thought I had already done that with the previous steps? – ashraj98 Nov 28 '15 at 16:15
  • We don't know. You haven't described what you actually did. – Michael Hampton Nov 28 '15 at 16:17
  • All I did was remove the old PHP packages, and installed the new PHP 5.6 the way described in the link I provided at the beginning. – ashraj98 Nov 28 '15 at 16:32
  • Just saying that you followed a guide doesn't work. Unless you can show us _exactly_ what you did, nobody can be sure. – Michael Hampton Nov 28 '15 at 16:34
  • 1
    The output of "rpm -qa '\*php\*' would help. Notice: you don't have to change httpd.conf. Never. "php" package put the needed configuration in /etc/httpd/conf.d/php.conf – Remi Collet Nov 28 '15 at 16:40
  • @RemiCollet updated the question with more details – ashraj98 Nov 28 '15 at 16:47
  • 1
    Are you certain you restarted Apache? That log entry is from six days ago! – Michael Hampton Nov 28 '15 at 16:51
  • Oh wait. The log file goes chronologically downward. Here's the most recent log `[Sat Nov 28 16:04:31.088545 2015] [mpm_prefork:notice] [pid 14852] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 PHP/5.6.16 SVN/1.7.14 configured -- resuming normal operations`. This looks like the only applicable statement. – ashraj98 Nov 28 '15 at 17:05
  • wbm-php-pear looks strange to me... seems a virtualmin server... not a CentOS one. – Remi Collet Nov 28 '15 at 17:55
  • Yes, virtualmin is installed, but its running on CentOS. Does virtualmin change anything? – ashraj98 Nov 28 '15 at 18:04
  • I have no idea how much altered is the distro when installing virtualmin. According to Apache signature "PHP/5.6.16" is installed, so should work. – Remi Collet Nov 28 '15 at 18:19
  • Yeah, I mean Virtualmin also states that PHP 5.6.16 is installed. – ashraj98 Nov 28 '15 at 22:20

0 Answers0