Rein Baarsma
Rein Baarsma

Reputation: 1536

PHP not working CentOS 6 after yum update

I had some problems running yum update and did the followingn steps to make it work:

  1. sudo yum --enablerepo=remi,remi-php55 -y remove memcached - this simply removed memcached, one of the packages giving errors
  2. sudo yum --enablerepo=remi,remi-php55 -y remove php-pear - this removed more than I bargained for..

Running Transaction Erasing : phpMyAdmin-4.0.4-1.el6.remi.noarch 1/28 waarschuwing: /etc/httpd/conf.d/phpMyAdmin.conf saved as /etc/httpd/conf.d/phpMyAdmin.conf.rpmsave Erasing : php-pecl-memcached-2.1.0-6.el6.remi.5.x86_64
2/28 Erasing : php-pecl-igbinary-1.1.2-0.5.git3b8ab7e.el6.remi.1.x86_64
3/28 Erasing : php-php-gettext-1.0.11-4.el6.remi.noarch
4/28 Erasing : php-pecl-mongo-1.4.1-1.el6.remi.1.x86_64
5/28 Erasing : php-pecl-sqlite-2.0.0-0.3.svn313074.el6.remi.5.x86_64
6/28 Erasing : php-pecl-memcache-3.0.8-1.el6.remi.1.x86_64
7/28 Erasing : php-pecl-apc-3.1.15-0.3.svn329913.el6.remi.1.x86_64
8/28 Erasing : php-5.5.0-1.el6.remi.x86_64
9/28 Erasing : php-gmp-5.5.0-1.el6.remi.x86_64
10/28 Erasing : php-mysqlnd-5.5.0-1.el6.remi.x86_64
11/28 Erasing : php-recode-5.5.0-1.el6.remi.x86_64
12/28 Erasing : php-tcpdf-dejavu-sans-fonts-6.0.049-1.el6.noarch 13/28 Erasing : php-tcpdf-6.0.049-1.el6.noarch
14/28 Erasing : php-bcmath-5.5.0-1.el6.remi.x86_64
15/28 Erasing : php-gd-5.5.0-1.el6.remi.x86_64
16/28 Erasing : php-mbstring-5.5.0-1.el6.remi.x86_64
17/28 Erasing : php-mcrypt-5.5.0-1.el6.remi.x86_64
18/28 Erasing : php-tidy-5.5.0-1.el6.remi.x86_64
19/28 Erasing : php-pgsql-5.5.0-1.el6.remi.x86_64
20/28 Erasing : php-pdo-5.5.0-1.el6.remi.x86_64
21/28 Erasing : php-intl-5.5.0-1.el6.remi.x86_64
22/28 Erasing : php-cli-5.5.0-1.el6.remi.x86_64
23/28 Erasing : php-process-5.5.0-1.el6.remi.x86_64
24/28 Erasing : php-xml-5.5.0-1.el6.remi.x86_64
25/28 Erasing : php-common-5.5.0-1.el6.remi.x86_64
26/28 waarschuwing: /etc/php.ini saved as /etc/php.ini.rpmsave
Erasing : php-pecl-jsonc-1.3.1-2.el6.remi.1.x86_64
27/28 Erasing : 1:php-pear-1.9.5-10.el6.remi.noarch
28/28 /usr/bin/pecl: regel 2: /usr/bin/php: Bestand of map bestaat niet /usr/bin/pecl: regel 2: exec: Kan /usr/bin/php niet uitvoeren: Bestand of map bestaat niet waarschuwing: /etc/pear.conf saved as /etc/pear.conf.rpmsave Verifying : php-bcmath-5.5.0-1.el6.remi.x86_64
1/28 Verifying : php-5.5.0-1.el6.remi.x86_64
2/28 Verifying : php-pecl-apc-3.1.15-0.3.svn329913.el6.remi.1.x86_64
3/28 Verifying : php-php-gettext-1.0.11-4.el6.remi.noarch
4/28 Verifying : php-mbstring-5.5.0-1.el6.remi.x86_64
5/28 Verifying : php-intl-5.5.0-1.el6.remi.x86_64
6/28 Verifying : phpMyAdmin-4.0.4-1.el6.remi.noarch
7/28 Verifying : php-tcpdf-6.0.049-1.el6.noarch
8/28 Verifying : php-tcpdf-dejavu-sans-fonts-6.0.049-1.el6.noarch 9/28 Verifying : php-recode-5.5.0-1.el6.remi.x86_64
10/28 Verifying : php-mcrypt-5.5.0-1.el6.remi.x86_64
11/28 Verifying : php-pecl-memcache-3.0.8-1.el6.remi.1.x86_64
12/28 Verifying : php-common-5.5.0-1.el6.remi.x86_64
13/28 Verifying : php-cli-5.5.0-1.el6.remi.x86_64
14/28 Verifying : 1:php-pear-1.9.5-10.el6.remi.noarch
15/28 Verifying : php-pecl-sqlite-2.0.0-0.3.svn313074.el6.remi.5.x86_64
16/28 Verifying : php-xml-5.5.0-1.el6.remi.x86_64
17/28 Verifying : php-pecl-mongo-1.4.1-1.el6.remi.1.x86_64
18/28 Verifying : php-tidy-5.5.0-1.el6.remi.x86_64
19/28 Verifying : php-pgsql-5.5.0-1.el6.remi.x86_64
20/28 Verifying : php-pdo-5.5.0-1.el6.remi.x86_64
21/28 Verifying : php-process-5.5.0-1.el6.remi.x86_64
22/28 Verifying : php-pecl-igbinary-1.1.2-0.5.git3b8ab7e.el6.remi.1.x86_64
23/28 Verifying : php-pecl-memcached-2.1.0-6.el6.remi.5.x86_64
24/28 Verifying : php-gd-5.5.0-1.el6.remi.x86_64
25/28 Verifying : php-pecl-jsonc-1.3.1-2.el6.remi.1.x86_64
26/28 Verifying : php-gmp-5.5.0-1.el6.remi.x86_64
27/28 Verifying : php-mysqlnd-5.5.0-1.el6.remi.x86_64
28/28

Removed: php-pear.noarch 1:1.9.5-10.el6.remi

Dependency Removed: php.x86_64 0:5.5.0-1.el6.remi
php-bcmath.x86_64 0:5.5.0-1.el6.remi
php-cli.x86_64 0:5.5.0-1.el6.remi
php-common.x86_64 0:5.5.0-1.el6.remi
php-gd.x86_64 0:5.5.0-1.el6.remi
php-gmp.x86_64 0:5.5.0-1.el6.remi
php-intl.x86_64 0:5.5.0-1.el6.remi
php-mbstring.x86_64 0:5.5.0-1.el6.remi
php-mcrypt.x86_64 0:5.5.0-1.el6.remi
php-mysqlnd.x86_64 0:5.5.0-1.el6.remi
php-pdo.x86_64 0:5.5.0-1.el6.remi
php-pecl-apc.x86_64 0:3.1.15-0.3.svn329913.el6.remi.1
php-pecl-igbinary.x86_64 0:1.1.2-0.5.git3b8ab7e.el6.remi.1
php-pecl-jsonc.x86_64 0:1.3.1-2.el6.remi.1
php-pecl-memcache.x86_64 0:3.0.8-1.el6.remi.1
php-pecl-memcached.x86_64 0:2.1.0-6.el6.remi.5
php-pecl-mongo.x86_64 0:1.4.1-1.el6.remi.1
php-pecl-sqlite.x86_64 0:2.0.0-0.3.svn313074.el6.remi.5
php-pgsql.x86_64 0:5.5.0-1.el6.remi
php-php-gettext.noarch 0:1.0.11-4.el6.remi
php-process.x86_64 0:5.5.0-1.el6.remi
php-recode.x86_64 0:5.5.0-1.el6.remi
php-tcpdf.noarch 0:6.0.049-1.el6
php-tcpdf-dejavu-sans-fonts.noarch 0:6.0.049-1.el6
php-tidy.x86_64 0:5.5.0-1.el6.remi
php-xml.x86_64 0:5.5.0-1.el6.remi
phpMyAdmin.noarch 0:4.0.4-1.el6.remi

  1. sudo yum --enablerepo=remi update - This only updated mysql, not apache or php
  2. sudo yum --enablerepo=remi install php-pear - this installed php again, but version 5.4.40

Install 5 Package(s)

Total download size: 5.4 M Installed size: 21 M Is this ok [y/N]: y Downloading Packages: (1/5): php-cli-5.4.40-1.el6.remi.x86_64.rpm
| 3.9 MB 00:00 (2/5): php-common-5.4.40-1.el6.remi.x86_64.rpm | 959 kB 00:00 (3/5): php-pear-1.9.5-10.el6.remi.noarch.rpm
| 357 kB 00:00 (4/5): php-process-5.4.40-1.el6.remi.x86_64.rpm | 64 kB 00:00 (5/5): php-xml-5.4.40-1.el6.remi.x86_64.rpm
| 174 kB 00:00

  1. sudo yum --enablerepo=remi,remi-php55 update - this updated php to version 5.5.24, which is what I want

Dependency Installed: php-pecl-jsonc.x86_64 0:1.3.7-1.el6.remi.5.5
php-pecl-zip.x86_64 0:1.12.5-1.el6.remi.5.5

Updated: php-cli.x86_64 0:5.5.24-1.el6.remi
php-common.x86_64 0:5.5.24-1.el6.remi php-process.x86_64 0:5.5.24-1.el6.remi php-xml.x86_64 0:5.5.24-1.el6.remi

Then I've restarted apache and mysql.

Now when I go to any of the (Wordpress) websites on this server, they either display the Apache 2 Test Page or the contents of index.php as plain text (no php execution).

I looked around on Stackoverflow and found some stuff on adding: LoadModule php5_module modules/libphp5.so

But unfortunately that file does not exist. locate libphp5.so gives /usr/lib64/httpd/modules/libphp5.so but LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so gives an error when restarting apache..

I think I've removed more php packages than intended, but I'm not sure which packages are missing and should be installed again. Can anyone point me in the right direction? And tell me wether I should reinstall apache or not? I'd rather not lose any config..

Upvotes: 0

Views: 2009

Answers (2)

Alex
Alex

Reputation: 6037

as stated in the error-message, there's an issue because it can not access the 'shared object file'. This can happen after installing new stuff and not running ldconfig. So, stop httpd, install your php modules and run ldconfig, then restart apache.

# ldconfig
# apachectl start 

Upvotes: -1

Rein Baarsma
Rein Baarsma

Reputation: 1536

Eventually I solved it somehow. I removed and (re)installed everything from httpd, php, php-common, php-cli, php-pear, php-mysql and also installed httpd-devel and php-devel

In this process I also manually created a php.conf in /etc/httpd/conf.d/

I also ran this from the centos forums: rpm -qa 'php*' rpm -V php

Eventually the correct php.conf was created in this process and after restarting apache everything is working again.

Upvotes: 0

Related Questions