Cuando instalas el panel de control webmin desde sus repositorios oficiales, por defecto viene con php 5.3, un tanto obsoleto para los tiempos que corren hoy en día. Vemos como actualizar y solucionar el error de dependencias que nos genera.
Comprobar la versión instalada de php.
php -v
La respuesta es:
PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Procedemos a la instalación.
Lo primero sera agregar los repositorios remi y epel.
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm
Editamos el repo remi.
nano /etc/yum.repos.d/remi.repo
Activamos el remi.
[remi] name=Remi's RPM repository for Enterprise Linux 6 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Activamos php 5.6 en el remi.
[remi-php56] name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch #baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/ mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror # WARNING: If you enable this repository, you must also enable "remi" enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Ahora realizamos el upgrade de php 5.3 a 5.6.
yum -y upgrade php*
Comprobamos la versión.
php -v
La respuesta debería ser similar a:
PHP 5.6.29 (cli) (built: Dic 22 2016 19:07:43) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
Posibles errores
Ahora…bien, es muy posible que nos lance un error de dependencias incumplidas, mas o menos como esto:
Error: Package: php-mysql-5.4.45-1.el6.remi.x86_64 (remi) Requires: php-pdo(x86-64) = 5.4.45-1.el6.remi Removing: php-pdo-5.3.3-27.el6.2.x86_64 (@LocalRepo) php-pdo(x86-64) = 5.3.3-27.el6.2 Updated By: php-pdo-5.5.29-1.el6.remi.x86_64 (remi-php55) php-pdo(x86-64) = 5.5.29-1.el6.remi Available: php-pdo-5.4.44-1.el6.remi.x86_64 (remi) php-pdo(x86-64) = 5.4.44-1.el6.remi Available: php-pdo-5.4.45-1.el6.remi.x86_64 (remi) php-pdo(x86-64) = 5.4.45-1.el6.remi Available: php-pdo-5.5.28-1.el6.remi.x86_64 (remi-php55) php-pdo(x86-64) = 5.5.28-1.el6.remi Available: php54w-pdo-5.4.44-1.w6.x86_64 (webtatic) php-pdo(x86-64) = 5.4.44-1.w6 Available: php55w-pdo-5.5.28-1.w6.x86_64 (webtatic) php-pdo(x86-64) = 5.5.28-1.w6 Available: php56w-pdo-5.6.12-1.w6.x86_64 (webtatic) php-pdo(x86-64) = 5.6.12-1.w6 Error: Package: php-pecl-apc-3.1.9-2.el6.x86_64 (@base) Requires: php(api) = 20090626 Removing: php-common-5.3.3-27.el6.2.x86_64 (@LocalRepo) php(api) = 20090626 Updated By: php-common-5.5.29-1.el6.remi.x86_64 (remi-php55) php(api) = 20121113-64 Available: php-common-5.4.44-1.el6.remi.x86_64 (remi) php(api) = 20100412-x86-64 Available: php-common-5.4.45-1.el6.remi.x86_64 (remi) php(api) = 20100412-x86-64 Available: php-common-5.5.28-1.el6.remi.x86_64 (remi-php55) php(api) = 20121113-64 Available: php54w-common-5.4.44-1.w6.x86_64 (webtatic) php(api) = 20100412-64 Available: php55w-common-5.5.28-1.w6.x86_64 (webtatic) php(api) = 20121113-64 Installing: php56w-common-5.6.12-1.w6.x86_64 (webtatic) php(api) = 20131106-64 Error: Package: php-pecl-apc-3.1.9-2.el6.x86_64 (@base) Requires: php(zend-abi) = 20090626 Removing: php-common-5.3.3-27.el6.2.x86_64 (@LocalRepo) php(zend-abi) = 20090626 Updated By: php-common-5.5.29-1.el6.remi.x86_64 (remi-php55) php(zend-abi) = 20121212-64 Available: php-common-5.4.44-1.el6.remi.x86_64 (remi) php(zend-abi) = 20100525-x86-64 Available: php-common-5.4.45-1.el6.remi.x86_64 (remi) php(zend-abi) = 20100525-x86-64 Available: php-common-5.5.28-1.el6.remi.x86_64 (remi-php55) php(zend-abi) = 20121212-64 Available: php54w-common-5.4.44-1.w6.x86_64 (webtatic) php(zend-abi) = 20100525-64 Available: php55w-common-5.5.28-1.w6.x86_64 (webtatic) php(zend-abi) = 20121212-64 Installing: php56w-common-5.6.12-1.w6.x86_64 (webtatic) php(zend-abi) = 20131226-64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
En el ejemplo el error lo imprime con php 5.5, pero bueno….. es lo mismo.
Si observas el culpable es el php-pecl-apc. Es evidente….. desde la versión 5.5 este fantástico optimizador cache ya viene integrado con php, por tanto no es necesario instalar independientemente el zend. Que hacemos?, pues muy sencillo… lo desinstalamos, actualizamos y activamos el correcto, mira que sencillo.
yum remove php-pecl-apc
yum update php*
yum install php-opcache
Problema solucionado y nuestro servidor actualizado.
Muchas gracias! Aunque a pasado tiempo, mi vps seguía con php 5.3 y me has sido de gran ayuda.
Gracias a ti por visitarnos.