Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section 3rd Party Software
  • Search

VestaCP MultiPHP (Debian/Ubuntu)

Section with additional software for Vesta
Post Reply
  • Print view
Advanced search
52 posts
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
ScIT
Support team
Posts: 617
Joined: Mon Feb 23, 2015 4:13 pm

Os: Ubuntu 17x
Web: apache + nginx
VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by ScIT » Tue Sep 27, 2016 7:28 am

Better way to solve it: viewtopic.php?f=41&t=17129

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.
Top

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

Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by skamasle » Tue Sep 27, 2016 5:44 pm

Will be nice do a script :)

And add php 5.5 and 5.6
Top

ScIT
Support team
Posts: 617
Joined: Mon Feb 23, 2015 4:13 pm

Os: Ubuntu 17x
Web: apache + nginx
Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by 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
Top

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

Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by 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.
Top

ScIT
Support team
Posts: 617
Joined: Mon Feb 23, 2015 4:13 pm

Os: Ubuntu 17x
Web: apache + nginx
Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by 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!
Top

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

Os: Debian 6x
Web: apache + nginx
Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by 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()
Top

ScIT
Support team
Posts: 617
Joined: Mon Feb 23, 2015 4:13 pm

Os: Ubuntu 17x
Web: apache + nginx
Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by 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.
Top

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

Os: Debian 6x
Web: apache + nginx
Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by 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.
Top

ScIT
Support team
Posts: 617
Joined: Mon Feb 23, 2015 4:13 pm

Os: Ubuntu 17x
Web: apache + nginx
Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by 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 :-).
Top

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

Os: Debian 6x
Web: apache + nginx
Re: VestaCP MultiPHP (Debian/Ubuntu)
  • Quote

Post by 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
Top


Post Reply
  • Print view

52 posts
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next

Return to “3rd Party Software”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password