How to change PHP version from 5.3 to 5.6 in Sentora/Zpanel?
1. VERIFY CURRENT VERSION OF PHP.
php -v
Output will be like.
PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.5.3, Copyright (c) 2002-2014, by ionCube Ltd.
PHP 5.3.3 (cli) (built: Mar 22 2017 12:27:09)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.5.3, Copyright (c) 2002-2014, by ionCube Ltd.
To update your PHP version to version 5.6, follow these steps:
- Install repository
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm- Remove older PHP version
yum remove php-common- Install PHP 5.6
yum install php56w php56w-mysql php56w-common php56w-pdo php56w-opcache php56w-mbstring php56w-gd php56w-mcrypt- Restart Apache
service httpd restart- Check PHP version
php --version
You will get something like:
PHP 5.6.40 (cli) (built: Jan 12 2019 09:19:57)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.4, Copyright (c) 2002-2019, by ionCube Ltd.
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.4, Copyright (c) 2002-2019, by ionCube Ltd.
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
If you face "PHP Fatal error: Call to undefined function mcrypt_module_open()", just run below command and restart your apache server.
yum clean all
yum remove epel-release
yum install epel-release
yum install php-mcrypt
service httpd restart
yum clean all
yum remove epel-release
yum install epel-release
yum install php-mcrypt
service httpd restart