VestaCP MultiPHP (Debian/Ubuntu) Topic is solved

Section with additional software for Vesta
ScIT
Posts: 235
Joined: Mon Feb 23, 2015 4:13 pm

VestaCP MultiPHP (Debian/Ubuntu)  Topic is solved

Postby ScIT » Tue Sep 27, 2016 7:28 am

Hi!

As already discussed in thread viewtopic.php?f=11&t=12691 and viewtopic.php?f=10&t=12734 I published "my" solution for VestaCP with MultiPHP and PHPBrew. The Solution is based on a little rewrite of the idea from Peter Anikin (http://anikin.pw/all/multiversionnost-p ... s-vestacp/).

You can find the guide on our GITLab Server: https://git.scit.ch/rs/VestaCP-MultiPHP

After installation you should be able to choose the different PHP Versions inside of VestaCP -> WEB -> Domain -> Web Template (Apache2):
Image

After that you have to rebuild the user with v-rebuild-user or inside of VestaCP Backend. Now you can use different PHP Versions for different Domains.

If you need to edit your php.ini file or include additional modules such as Ioncube you will find it under: /usr/local/php/php/php_x.x.x/etc/php.ini - after modification you don't need to restart Apache2, the change will be loaded directly with the next request over php cgi.

MultiPHP is tested on Ubuntu Server 14.04 LTS, maybe someone can try this on Debian and let us know if it works.

Best Regards
Raphael

Edit 2016-09-27: Modified Installation Guide and added setup informations for PHP 5.5 and 5.6.
I would suggest to switch base system to PHP 5.6, only 5.x version that is still supported (http://php.net/supported-versions.php) - then you can still switch to 5.4 or 5.3 if needed.
Last edited by ScIT on Tue Sep 27, 2016 7:53 pm, edited 1 time in total.

skamasle
Posts: 355
Joined: Mon Feb 29, 2016 6:36 pm

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby skamasle » Tue Sep 27, 2016 5:44 pm

Will be nice do a script :)

And add php 5.5 and 5.6

ScIT
Posts: 235
Joined: Mon Feb 23, 2015 4:13 pm

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby ScIT » Tue Sep 27, 2016 6:16 pm

skamasle wrote:Will be nice do a script :)

And add php 5.5 and 5.6


Script is not planed, compiling takes long and I think it's better to do this setup "step by step" for each server. If you have more then 4 or 5 VestaCP Server you can do a script by yourself.

PHP 5.5 and 5.6 is not a problem, our systems runs with PHP 5.6 thats because it is not listed. I've updated the Documentation to add the requested PHP 5.5 and 5.6 versions.

I would suggest to switch base system on PHP 5.6, only 5.x version that is supported (http://php.net/supported-versions.php). Then you can still switch to 5.4 or 5.3 if needed.

Best Regards
Raphael

MaryGutierrez
Posts: 4
Joined: Thu Sep 29, 2016 6:03 am

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby MaryGutierrez » Thu Sep 29, 2016 6:09 am

Either rebuild the user with v-rebuild-user or inside of VestaCP Backend. Now you are able to use different PHP Versions for different Domains.

ScIT
Posts: 235
Joined: Mon Feb 23, 2015 4:13 pm

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby ScIT » Thu Sep 29, 2016 7:11 am

MaryGutierrez wrote:Either rebuild the user with v-rebuild-user or inside of VestaCP Backend. Now you are able to use different PHP Versions for different Domains.


Yep, like it's written in thread and guide :-). I'm glad that it works for you!

pligin
Posts: 32
Joined: Tue Jun 21, 2016 5:32 am

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby pligin » Tue Nov 08, 2016 7:17 pm

[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: /root/.phpbrew/bashrc: line 17: syntax error near unexpected token `$'\r''
'bash: /root/.phpbrew/bashrc: line 17: `function __phpbrew_set_path()

ScIT
Posts: 235
Joined: Mon Feb 23, 2015 4:13 pm

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby ScIT » Tue Nov 08, 2016 7:44 pm

pligin wrote:[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: /root/.phpbrew/bashrc: line 17: syntax error near unexpected token `$'\r''
'bash: /root/.phpbrew/bashrc: line 17: `function __phpbrew_set_path()


Please check your bashrc file on line 17, maybe it's a problem like here described: http://stackoverflow.com/questions/6473 ... token-in-r

If this does not resolv the problem, please post more information about your OS and VestaCP Version.

Thank you.

pligin
Posts: 32
Joined: Tue Jun 21, 2016 5:32 am

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby pligin » Tue Nov 08, 2016 8:50 pm

Installed PHP 5.3
Don't work

Not Found

The requested URL /cgi-bin/php/phpinfo.php was not found on this server.

ScIT
Posts: 235
Joined: Mon Feb 23, 2015 4:13 pm

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby ScIT » Tue Nov 08, 2016 9:19 pm

pligin wrote:Installed PHP 5.3
Don't work

Not Found

The requested URL /cgi-bin/php/phpinfo.php was not found on this server.


Do you have rebuilded your user? In VestaCP under User -> Rebuild or over command line v-rebuild-user username. If you follow the tutorial "step by step" it "have" to work :-).

pligin
Posts: 32
Joined: Tue Jun 21, 2016 5:32 am

Re: VestaCP MultiPHP (Debian/Ubuntu)

Postby pligin » Tue Nov 08, 2016 9:27 pm

ScIT wrote:
pligin wrote:Installed PHP 5.3
Don't work

Not Found

The requested URL /cgi-bin/php/phpinfo.php was not found on this server.


Do you have rebuilded your user? In VestaCP under User -> Rebuild or over command line v-rebuild-user username. If you follow the tutorial "step by step" it "have" to work :-).

Yes
I think this script is not working

Code: Select all

wrapper_script='#!/usr/local/php/php53/bin/php-cgi -c/usr/local/php/php53/etc/php.ini'
wrapper_file="/home/$user/web/$domain/cgi-bin/php"

echo "$wrapper_script" > $wrapper_file
chown $user:$user $wrapper_file
chmod -f 751 $wrapper_file


in the folder "home/$user/web/$domain/cgi-bin/php" does not create any files

P.S. nginx + apache2


Return to “3rd Party Software”



Who is online

Users browsing this forum: No registered users and 3 guests