Page 1 of 1

HOWTO: Upgrade VestaCP to PHP7.2 on Debian 9

Posted: Sat Feb 17, 2018 11:51 pm
by tkramer
Hi folks! This topic share steps that i used to upgrade my server! I hope helps someone!

Ondřej Surý has released PHP 7.2.0 packages over a year ago for both Debian GNU/Linux 9. I use 9.3 and it works fine! Follow this steps to enable repository and configurate PHP 7.2 as a default version on vestaCP.

First of all: BACKUP!

Add the deb.sury.org PHP repository to your Debian installation, run as root:

*install this first

Code: Select all

apt-get install apt-transport-https lsb-release ca-certificates
*add gpg keys

Code: Select all

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
*add sury repo to your source list

Code: Select all

sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
*update your packages

Code: Select all

apt-get update
*install PHP 7.2 with MySQL/MariaDB and php-fpm support and others libs commonly used by vesta:

Code: Select all

apt-get install php7.2-common libapache2-mod-php7.2 php7.2-cgi php7.2-cli php7.2-phpdbg php7.2-fpm libphp7.2-embed php7.2-dev php7.2-curl php7.2-gd php7.2-imap php7.2-interbase php7.2-intl php7.2-ldap php7.2-readline php7.2-odbc php7.2-pgsql php7.2-pspell php7.2-recode php7.2-tidy php7.2-xmlrpc php7.2 php7.2-json php-all-dev php7.2-sybase php7.2-sqlite3 php7.2-mysql php7.2-opcache php7.2-bz2 libapache2-mod-php7.2 php7.2-mbstring php7.2-pdo php7.2-dom php7.2-enchant php7.2-gmp php7.2-soap php7.2-zip
*php7.2 does not have anymore support to mcrypt extension, but you can install following these steps:

*install and add mcrypt support to php7.2

Code: Select all

apt-get -y install gcc make autoconf libc-dev pkg-config

Code: Select all

apt-get -y install libmcrypt-dev

Code: Select all

apt-get install php7.2-dev

Code: Select all

pecl install mcrypt-1.0.1
*When you see the prompt "libmcrypt prefix? [autodetect] :" -> Press [Enter] to autodetect

*After success installing mcrypt trought pecl, you should add mcrypt.so extension to php.ini, The output will look like this:
Build process completed successfully
Installing '/usr/lib/php/20170718/mcrypt.so' ----> this is our path to mcrypt extension lib
install ok: channel://pecl.php.net/mcrypt-1.0.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=mcrypt.so" to php.ini
*Verify that the extension was installed, running the command:

Code: Select all

php -i | grep "mcrypt"
*The output will look like this:
/etc/php/7.2/cli/conf.d/mcrypt.ini
Registered Stream Filters => zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, convert.iconv.*, mcrypt.*, mdecrypt.*
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
*disable old panel php (7.0)

Code: Select all

a2dismod php7.0
*enable new php7.2 on panel

Code: Select all

a2enmod php7.2
*Verify all with php -v and phpinfo();

That's all!! I have use this on my production server and everything is ok, but if you are smart: test, test, test, test again and enjoy!!!

*sources:
http://www.linuxcompatible.org/news/sto ... an_89.html
https://medium.com/@eAdnan007/upgrading ... 2849ed18e0
https://lukasmestan.com/install-mcrypt- ... in-php7-2/

Re: HOWTO: Upgrade VestaCP to PHP7.2 on Debian 9

Posted: Tue Dec 04, 2018 5:44 pm
by one
And this work correctly? Does anyone have try it? And who is this guy Ondřej Surý?

Re: HOWTO: Upgrade VestaCP to PHP7.2 on Debian 9

Posted: Fri Jan 25, 2019 2:04 pm
by katod
one wrote:
Tue Dec 04, 2018 5:44 pm
And this work correctly? Does anyone have try it? And who is this guy Ondřej Surý?
yes, it works

about Ondřej Surý https://www.patreon.com/oerdnj

Re: HOWTO: Upgrade VestaCP to PHP7.2 on Debian 9

Posted: Fri Nov 08, 2019 8:47 pm
by ColeAndr
Why putty v7.3.11 is displayed? (command php-v)