Upgrading to PHP 5.6.9

Issues related to applications and software problems
Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Upgrading to PHP 5.6.9

Post by Kunwar » 2015/05/16 15:35:58

I have a centos 7 localarea server that is hosting a test version of crm... I copied the php script to the www/html director but php is giving out errors... I need to update PHP version but I don't know how to do that any help will be highly appreciated.

I found this document but I am not sure how to use it: http://awel.domblogger.net/7/php/

When i run the following command I get the results:

Code: Select all

# yum list installed | grep "php"
php.x86_64                             5.4.16-23.el7_0.3               @base    
php-cli.x86_64                         5.4.16-23.el7_0.3               @base    
php-common.x86_64                      5.4.16-23.el7_0.3               @base    
php-mysql.x86_64                       5.4.16-23.el7_0.3               @base    
php-pdo.x86_64                         5.4.16-23.el7_0.3               @base    
But when I try to run

Code: Select all

# yum update php
no packages were found.

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Upgrading to PHP 5.6.9

Post by Kunwar » 2015/05/16 15:43:42

I am sorry, if I caused any inconvenience. I was able to upgrade to PHP 5.6.9 by following the following instructions (Reference: https://webtatic.com/packages/php56/)


To install, first you must add the Webtatic EL yum repository information corresponding to your CentOS/RHEL version to yum:

CentOS/RHEL 7.x:

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/web ... elease.rpm
CentOS/RHEL 6.x:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Now you can install PHP 5.6 (along with an opcode cache) by doing:

yum install php56w php56w-opcache
If you would like to upgrade php to this version it is recommended that you first check that your system will support the upgrade, e.g. making sure any CPanel-like software can run after the upgrade.

Unless you know what you are doing, it is risky upgrading an existing system. It’s much safer to do this by provisioning a separate server to perform the upgrade as a fresh install instead.

If you know what you are doing, you can upgrade PHP by:

yum install yum-plugin-replace

yum replace --enablerepo=webtatic-testing php-common --replace-with=php56w-common
It will likely give you a message “WARNING: Unable to resolve all providers …”. This is normal, and you can continue by tying “y“. You will be given a chance to see what packages will be installed and removed before again being given a chance to confirm.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Upgrading to PHP 5.6.9

Post by gerald_clark » 2015/05/16 15:46:58


User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Upgrading to PHP 5.6.9

Post by TrevorH » 2015/05/16 18:49:48

We do not recommend use of the Webtatic repo under any circumstances.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Upgrading to PHP 5.6.9

Post by Kunwar » 2015/05/17 11:52:36

TrevorH, I didn't know that. I am new to Linux. Is there any specific reason behind it? and since I have used it already. What do I do now?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Upgrading to PHP 5.6.9

Post by TrevorH » 2015/05/17 13:00:05

The webtatic repo contains many packages with names that conflict with the names of packages in CentOS base and updates repos. This means that it replaces packages supplied by CentOS without warning. Examine your /var/log/yum.log and see what else got updated at the same time as the php packages were installed (or afterwards). Use rpm -qi $packagename to check to make sure that the buildhost is a CentOS one and that the signing key is the CentOS one for each of those.

The IUS Community repo is a better source of replacement packages since they are all named differently than the ones CentOS supply so you have to take explicit action to install them.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Upgrading to PHP 5.6.9

Post by Kunwar » 2015/05/17 16:32:31

Thanks, I'll keep that in mind. Since after the upgrade I am getting this error on my webpage:

Code: Select all

Warning: mysqli_connect(): Headers and client library minor version mismatch. Headers:50541 Library:50624 in /var/www/html/empbook/includes/db_connection.php on line 2
As per my research it's related to the upgrade I performed recently but I haven't been able to find the solution.

also the loading sequence off the css files id different on the centos hosting than my computer, I am running xampp on windows and rendering the website a little different than actual.

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: Upgrading to PHP 5.6.9

Post by remirepo » 2015/05/17 17:02:42

Switch to php-mysqlnd (same extensions provided) and get rid of dependency on libmysqlclient (and so of such message)
Remi's Repository - Forum - Blog

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Upgrading to PHP 5.6.9

Post by Kunwar » 2015/05/17 18:03:10

I have removed the other packages and installed php-mysqlnd and now the installed and following are the package details.

Code: Select all

[root@paradahtml]# yum list installed | grep "php"
php-common.x86_64                      5.4.16-23.el7_0.3               @base    
php-mysqlnd.x86_64                     5.4.16-23.el7_0.3               @base    
php-pdo.x86_64                         5.4.16-23.el7_0.3               @base    

[root@paradahtml]# yum list installed | grep "mysql"
mysql-community-client.x86_64          5.6.24-3.el7                    @mysql56-community
mysql-community-common.x86_64          5.6.24-3.el7                    @mysql56-community
mysql-community-libs.x86_64            5.6.24-3.el7                    @mysql56-community
mysql-community-release.noarch         el7-5                           installed
mysql-community-server.x86_64          5.6.24-3.el7                    @mysql56-community
php-mysqlnd.x86_64                     5.4.16-23.el7_0.3               @base    
I restarted Apache(httpd) and php has stopped working with apache... i tried to lookup solutions. But I cant find the problem. phpinfo() is also displaying as text. php.ini is also missing from /etc/php.d

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Upgrading to PHP 5.6.9

Post by gerald_clark » 2015/05/17 18:51:37

CentOS does not provide MySQL. Instead, it supplies the compatible MariaDB.
Support for mysql-community can be obtained from mysql-community.

Post Reply