Vesta: MultiPHP VestaCP

Created on 11 May 2018  路  8Comments  路  Source: serghey-rodin/vesta

Operating System (OS/VERSION):

All

VestaCP Version:

All

Installed Software (what you got with the installer):

Not applicable

Steps to Reproduce:

https://git.scit.ch/rs/VestaCP-MultiPHP

Other Notes:

I saw that in cPanel you have the possibility to manage multi versions of PHP.
I come here to suggest two possible inclusions, so if you're not already working on it, VestaCP is too fast to evolve.

So two interesting things for the whole community would be the ability to manage the php version per domain (template).
The other suggestion would be on a page to install modules and versions of PHP.

It would be an Evolution.
If I'm wrong just ignore.

feature request

Most helpful comment

@luizjrdeveloper

The other suggestion would be on a page to install modules and versions of PHP

its good idea, thank you. We'll do it

All 8 comments

That would be a good idea to have... but I'm not sure it's possible to implement in VestaCP... at least, not with the way things as they stand.

Can be done with php-fpm, even if apache installed.
I will write HOWTO on forum in next few months, when I get free time.

@dpeca Writing in the forum a good way for me would already help.

From my own manual procedure, here's how to install PHP 5.6 on VestaCP on Debian 9.0

Launch commands one by one manually

apt-get install build-essential libssl-dev libxml2-dev pkg-config libssl-dev libbz2-dev libcurl4-openssl-dev libgdbm-dev libjpeg62 libxml2 libxml2-dev libmcrypt4 libmcrypt-dev libmhash2 libmhash-dev libmm-dev libmm14 libtidy-dev libxslt1-dev libxslt1.1 libfreetype6 libfreetype6-dev libicu-dev libreadline-dev bzip2 libpcre3-dev libjpeg-dev libonig-dev libpspell-dev

apt-get install libcurl4-gnutls-dev

ln -s /usr/include/x86_64-linux-gnu/curl /usr/local/include/curl

mkdir /php/
mkdir /php/src

#first check if newer PHP 5.6 released
wget -O /php/src/php-5.6.34.tar.bz2 http://de2.php.net/get/php-5.6.34.tar.bz2/from/this/mirror
cd /php/src/
tar -xjf php-5.6.34.tar.bz2
cd php-5.6.34

mkdir /php/php56

./configure \
--prefix=/php/php56 \
--with-config-file-path=/etc \
--with-regex=php \
--disable-rpath \
--disable-static \
--with-pic \
--with-layout=GNU \
--enable-calendar \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-bcmath \
--with-bz2 \
--enable-ctype \
--with-cdb \
--with-iconv \
--enable-exif \
--enable-ftp \
--with-gettext \
--enable-mbstring \
--with-onig=/usr \
--with-pcre-regex=/usr \
--enable-shmop \
--enable-sockets \
--enable-wddx \
--with-libxml-dir=/usr \
--with-zlib \
--with-kerberos=/usr \
--enable-soap \
--enable-zip \
--with-mhash=yes \
--with-mysql-sock=/var/run/mysqld/mysqld.sock \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--enable-pdo \
--with-pdo-mysql=mysqlnd \
--enable-exif \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir=/usr \
--with-zlib-dir=/usr \
--with-mcrypt=/usr \
--with-mhash \
--with-xsl=/usr \
--enable-zip \
--enable-cgi \
--with-curl \
--with-gd \
--enable-pcntl \
--enable-mbregex \
--enable-gd-native-ttf \
--with-libdir=lib64 \
--enable-dba=shared \
--enable-intl \
--with-readline=/usr \
--enable-simplexml \
--with-libdir=/lib/x86_64-linux-gnu \
--with-config-file-scan-dir="$instdir"/etc \
--with-pspell

make
make install

ln -s /php/php56/bin/php /usr/local/vesta/php/bin/php56
ln -s /php/php56/bin/php /usr/bin/php56
ln -s /php/php56/bin/php-cgi /usr/bin/php56-cgi


a2enmod cgi
systemctl restart apache2


cp /usr/local/vesta/data/templates/web/apache2/phpcgi.sh /usr/local/vesta/data/templates/web/apache2/php56.sh
cp /usr/local/vesta/data/templates/web/apache2/phpcgi.stpl /usr/local/vesta/data/templates/web/apache2/php56.stpl
cp /usr/local/vesta/data/templates/web/apache2/phpcgi.tpl /usr/local/vesta/data/templates/web/apache2/php56.tpl

# Open the file /usr/local/vesta/data/templates/web/apache2/php56.sh e find the line
# wrapper_script='#!/usr/bin/php-cgi -cphp5-cgi.ini'
# and replace it with
# wrapper_script='#!/usr/bin/php56-cgi -cphp5-cgi.ini'

/usr/local/vesta/bin/v-rebuild-user admin

systemctl restart vesta

Hello! I followed the installation as above, in Debian 9 to have multiple PHP.
Kindly can you tell me how to have also ioncube_loader_lin_5.6.so for php5.6 together in multiple php with php7 ? (in php7 there is already and is working but ...) In php5.6 I do not know how to load it because I miss the php.ini configuration file separate for php5.6

@luizjrdeveloper

The other suggestion would be on a page to install modules and versions of PHP

its good idea, thank you. We'll do it

@anton-reutov we can get multi php (compiled) from:
(Ubuntu/debian)
add-apt-repository ppa:ondrej/php

I don't know if there is another repo for the other distros that vesta supports but that could be a help to the vestaCP.

Also, it isn't a bad idea to organize the domains as domain |_Subdomain as i showed in #1679 (images below)
Panel:

Domain:
test 1
Options:
test 1 - 2
Subdomain Listing
image

test subdomain listing
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaniWinter picture DaniWinter  路  5Comments

rinkuyadav999 picture rinkuyadav999  路  5Comments

cakama3a picture cakama3a  路  5Comments

aleksandarstojkovski picture aleksandarstojkovski  路  7Comments

tlcd96 picture tlcd96  路  5Comments