- Vesta Control Panel — Forum
- [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
- Vesta Control Panel — Forum
- VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.
- Обновление версии php на VestaCP с CentOS, без переустановки php, до версии 7.4
- Вам также может понравиться
- Восстановление структуры MySQL таблицы из frm файла
- Как сбросить root пароль MySQL или MariaDB на Centos, Debian, Ubuntu.
- Информация
- Свежие записи
Vesta Control Panel — Forum
[HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
[HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by xorro » Tue Sep 11, 2018 6:27 pm
In this tutorial I’ll show you how to upgrade PHP 5.6.xx which is by default installed by Vesta CP during installation to PHP 7.2.xx latest, I’ve tested on many server before writing this tutorial and its just working fine without any issue hence it is safe to upgrade to PHP 7.2, part of this tutorial is copied from remi repository.
Why upgrade to php 7.2 – Because it will give you security & performance boost + KICK, since WordPress will load much faster and uses less resources.
Install Remi Repository and EPEL Repository on your server :
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm subscription-manager repos --enable=rhel-7-server-optional-rpms
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm rhn-channel --add --channel=rhel-$(uname -i)-server-optional-6
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
After you have installed repository you need to follow some extra configurations :
Run this command one by one for RHEL or CentOS
yum install yum-utils yum-config-manager --enable remi-php72
Now just run this command :
You’ll see php packages are getting updated, After the update process you need to restart Apache server/php-fpm-(nginx) and check the php version from by below mentioned command:
[root@server ~]# php -v PHP 7.2.7 (cli) (built: Jun 20 2018 08:21:26) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.7, Copyright (c) 1999-2018, by Zend Technologies
If php upgrade process fails (no update/nothing happens) or you upgraded previously from 5.6 to 7.0/7.1 then you need to run this commands to disable php 5.6/7.0/7.1 :
yum-config-manager --disable remi-php56 yum-config-manager --disable remi-php70 yum-config-manager --disable remi-php71
valentine Posts: 16 Joined: Sat Sep 01, 2018 4:10 am
Os: Ubuntu 15x Web: nginx + php-fpm
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by valentine » Thu Sep 13, 2018 2:16 am
pipoy Posts: 112 Joined: Mon Sep 11, 2017 8:02 am
Os: CentOS 6x Web: apache
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by pipoy » Wed Sep 19, 2018 12:03 am
pro100ssk Posts: 111 Joined: Mon Oct 19, 2015 12:12 pm
Os: Debian 8x Web: apache + nginx
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by pro100ssk » Tue Nov 27, 2018 10:27 pm
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by sandy » Sat Dec 29, 2018 7:43 pm
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by lex0013 » Mon Apr 08, 2019 5:07 am
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by zzmaster » Sat Oct 26, 2019 9:57 am
[root@celebraza ~]# rhn-channel --add --channel=rhel-$(uname -i)-server-optional-6 -bash: rhn-channel: command not found
It’s strange that topic starter didn’t face this since rhn-channel not in standard configuration. The only googled related page
https://support.nagios.com/forum/viewto . =6&t=50150
has solutions that don’t work for me.
lokutus Posts: 2 Joined: Wed Apr 11, 2018 8:52 am
Os: CentOS 5x Web: apache + nginx
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by lokutus » Mon Nov 04, 2019 3:33 pm
i followed your desc and PHP is 7.4.0RC5 version now, but i have some issue in PHPmyadmin. How can i solve this Problem?
need i downgrade PHP or anything else?
Re: [HowTo]Upgrade PHP 5.6 to PHP 7.2 on CentOS VestaCP
Post by Nightmaster » Fri Aug 14, 2020 2:54 pm
Hey guys!
I just followed steps like written above to update from 5.6 to 7.2 version.
After all i rebooted server, and when i do php -v i get this:
PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'mysql.so' (tried: /usr/lib64/php/modules/mysql.so (/usr/lib64/php/modules/mysql.so: undefined symbol: mysqlnd_connect), /usr/lib64/php/modules/mysql.so.so (/usr/lib64/php/modules/mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP Warning: Module 'json' already loaded in Unknown on line 0 PHP 7.2.33 (cli) (built: Aug 4 2020 09:54:49) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies [root@server etc]#
I tried to find mcrypt and json in php.ini and remove those, but there are no such lines?
Also, when i upload phpinfo(); file on my server it’s showing my php version is -> PHP Version 5.4.45, how is that possible? My WP installations stopped working, it’s throwing errors:
Do you have any ideas what may be wrong?
Vesta Control Panel — Forum
VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.
VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.
Post by skamasle » Fri Mar 04, 2016 9:08 pm
PHP SELECTOR IS NOT OFFICIALLY SUPPORTED BY VESTACP RUN AT YOUR OWN RISK — THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY
This is a personal script
— This script using vesta templates.
— This script using remi repo.
— I make this script to help people who whant run Multiple PHP versions on vestacp, is easy to do manually but this script makes it easier even
— Ubuntu PHP selector for vesta ?
— There is some variables for ubuntu and debian release
— Not SUPPORT NGINX + PHP-FPM
Some caps:
===========================================
Need select php version you install ? read in github new options in beta 0.3 -> https://github.com/Skamasle/sk-php-selector
UPDATE
Beta 0.2.4 - Added php 7.1 and php 7.2RC3 - Fix some issues with phpmyadmin
Latest: -Support PHP 54 to php74 - Can install individual php versions as you need ! check info in github
Beta 0.2.3 - Remove some code and tests. - Using simlinks for templates. [code]Beta 0.2.2 - Fix bug on centos 6 paths thanks @tjebbeke to reporting -- Now check twice php path on centos 6 - Fix Include Optional on centos 6
Beta 0.2.1 - Working on Centos 6.7 and Centos 7 - Detect PHP versión. - Install php 5.4, php 5.5, php 5.6 and php 7. - Support if php was upgraded, skip that version. -- Requirements: - Centos 6 or centos 7 - Default vetacp installed whit remi repo
Run at own risk ! still in beta, This it provided without any warranty !
Need select php version you install ? read in github new options in beta 0.3 -> https://github.com/Skamasle/sk-php-selector
Need PHP 5.2 ?
Multiple PHP on VestaCP — Adding Modules
You can install any modules to aditional php versión using remi repo:
yum search php70 --enablerepo=remi |grep opcache #output: php70-php-opcache.x86_64 : The Zend OPcache
yum install php70-php-opcache --enablerepo=remi
/usr/bin/php70 --ini |grep opcache Additional .ini files parsed: /etc/opt/remi/php70/php.d/10-opcache.ini,
Some problems whit big files on joomla, wordpress, plugins or modules fix -> http://forum.vestacp.com/viewtopic.php? . 843#p43749
Update main PHP version and get phpmyadmin broken -> viewtopic.php?f=19&t=10854&p=67369#p67369 no script fail
Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.
Post by pandabb » Sat Mar 05, 2016 3:22 pm
Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.
Post by skamasle » Sat Mar 05, 2016 9:29 pm
- Features: - Work on centos 6.7 and centos 7 - Detect current php. - Install php 5.4, php 5.5, php 5.6 and php 7, if there is a php installed skip that versión.
tjebbeke Collaborator Posts: 783 Joined: Mon May 11, 2015 8:43 am Contact:
Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.
Post by tjebbeke » Sun Mar 06, 2016 10:52 am
apachectl configtest [Sun Mar 06 10:51:08 2016] [warn] module php5_module is already loaded, skipping [Sun Mar 06 10:51:08 2016] [warn] module php5_module is already loaded, skipping Syntax error on line 331 of /home/username/conf/web/httpd.conf: Invalid command 'IncludeOptional', perhaps misspelled or defined by a module not included in the server configuration
Change IncludeOptional to Include works on your templates.
Accessing my website with your php7 template also not working 🙁
[Sun Mar 06 10:56:49 2016] [warn] [client 84.192.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Sun Mar 06 10:56:49 2016] [error] [client 84.192.xxx.xxx] Premature end of script headers: phpinfo.php [Sun Mar 06 10:56:49 2016] [warn] [client 84.192.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://www.mydomain.com/phpinfo.php [Sun Mar 06 10:56:49 2016] [error] [client 84.192.xxx.xxx] Premature end of script headers: index.php, referer: http://www.mydomain.com/phpinfo.php
Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.
Post by skamasle » Sun Mar 06, 2016 11:53 am
Let me try reproduce errores.
The include optional is fixed on beta 0.2.2
cd /usr/local/vesta/data/templates/web/httpd/ replace -v "IncludeOptional %home%/%user%/conf/web/httpd.%domain%.conf*" "Include %home%/%user%/conf/web/httpd.%domain%.conf*" -- sk*.tpl > /dev/null replace -v "IncludeOptional %home%/%user%/conf/web/shttpd.%domain%.conf*" "Include %home%/%user%/conf/web/shttpd.%domain%.conf*" -- sk*.stpl > /dev/null
Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.
Post by skamasle » Sun Mar 06, 2016 12:30 pm
apachectl configtest [Sun Mar 06 10:51:08 2016] [warn] module php5_module is already loaded, skipping [Sun Mar 06 10:51:08 2016] [warn] module php5_module is already loaded, skipping Syntax error on line 331 of /home/username/conf/web/httpd.conf: Invalid command 'IncludeOptional', perhaps misspelled or defined by a module not included in the server configuration
Change IncludeOptional to Include works on your templates.
Accessing my website with your php7 template also not working 🙁
[Sun Mar 06 10:56:49 2016] [warn] [client 84.192.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Sun Mar 06 10:56:49 2016] [error] [client 84.192.xxx.xxx] Premature end of script headers: phpinfo.php [Sun Mar 06 10:56:49 2016] [warn] [client 84.192.xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server, referer: http://www.mydomain.com/phpinfo.php [Sun Mar 06 10:56:49 2016] [error] [client 84.192.xxx.xxx] Premature end of script headers: index.php, referer: http://www.mydomain.com/phpinfo.php
I found the problem and is fixed 🙂
Just run new installer again and it fix.
Обновление версии php на VestaCP с CentOS, без переустановки php, до версии 7.4
Если Вам необходимо поднять версию php на Вашем сервере, на котором стоит операционная система CentOS 6 или CentOS 7, с панелью управления VestaCP, тогда воспользуемся репозиториями remi и EPEL. Для этого:
1. Установим репозитории Remi и EPEL:
Если у Вас ОС CentOS 7:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
Если у Вас ОС CentOS 6:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
2. Выполним следующие команды:
yum -y install yum-utils yum-config-manager --enable remi-php74
В данном примере приведена команда для установки php 7.4 на Ваш сервер. Если Вам нужна другая версия php, например 7.3, тогда вместо remi-php74 в последней команде, указывайте remi-php73. Аналогично и для более ранних версий php: remi-php72 для php 7.2, remi-php71 для php 7.1, remi-php56 для php 5.6 и тд.
3. Выполним обновление пакетов, во время которого установится новая версия php:
4. Как только обновление пакетов завершится, перезагрузим веб-серверы:
service httpd restart; service nginx restart
Теперь проверим, какая версия php сейчас работает на сервере: