Page 1 of 28

VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.

Posted: Fri Mar 04, 2016 9:08 pm
by skamasle
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

SK PHP Selector:

- 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:
Image
SpoilerShow
Image
Image
Image
Image
===========================================
Image

Need select php version you install ? read in github new options in beta 0.3 -> https://github.com/Skamasle/sk-php-selector
UPDATE

Code: Select all

Beta 0.2.4
- Added php 7.1 and php 7.2RC3
- Fix some issues with phpmyadmin
- This version is available from github -> https://github.com/Skamasle/sk-php-selector

Code: Select all

Latest:
-Support PHP 54 to php74
- Can install individual php versions as you need ! check info in github

Code: Select all

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

Code: Select all

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
Image

beta 0.2.3 installer:

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 ?

Check this -> viewtopic.php?f=19&t=13406

Multiple PHP on VestaCP - Adding Modules

You can install any modules to aditional php versión using remi repo:

Search module:

Code: Select all

yum search php70 --enablerepo=remi |grep opcache
#output:
php70-php-opcache.x86_64 : The Zend OPcache
Install:

Code: Select all

yum install php70-php-opcache --enablerepo=remi
Then search ini if need it:

Code: Select all

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

Posted: Sat Mar 05, 2016 3:22 pm
by pandabb
looks good.

anyone have tried this?

Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.

Posted: Sat Mar 05, 2016 9:29 pm
by skamasle
Working on beta 0.2.1

Look like this:

Image

Not public yet

Code: Select all

- 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.
- Requisites:
- Centos 6 or 7
- Default vesta install whit remi.repo

Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.

Posted: Sun Mar 06, 2016 10:52 am
by tjebbeke
Good work!
On centos 6.7 I have this error:

Code: Select all

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 :(

Code: Select all

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

Posted: Sun Mar 06, 2016 11:53 am
by skamasle
Hi

Let me try reproduce errores.

The include optional is fixed on beta 0.2.2

You can fixed it whit:

Code: Select all

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.

Posted: Sun Mar 06, 2016 12:30 pm
by skamasle
tjebbeke wrote:Good work!
On centos 6.7 I have this error:

Code: Select all

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 :(

Code: Select all

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

Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.

Posted: Mon Mar 07, 2016 1:18 am
by pandabb
this is great :D

waiting for final release.

Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.

Posted: Mon Mar 07, 2016 1:32 am
by baijianpeng
Great idea!

Today I tested this script on a fresh installation of CentOS 7 64-bit minimal on VirtualBox with VestaCP latest version. The script runs smoothly and installed php55, php56 and php70 for me.

Now, the question is: where are those php.ini files respectively? I want to modify some PHP configuration such as max upload size.

Thank you.

Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.

Posted: Mon Mar 07, 2016 7:53 am
by skamasle
Hi,

You can check php ini path on info.php

But is in /opt/remi/root/phpversión/etc/php.ini

Re: VestaCP PHP Selector for Centos add php 7, 5.6 and 5.5.

Posted: Mon Mar 07, 2016 8:50 am
by baijianpeng
A little different on my centos 7 server:

Code: Select all

/opt/remi/$PHPVERSION/root/etc/php.ini
PS: I have two suggestions for your multi-php installer script:

1. please add "progress bar" for installing process, to avoid users think "nothing happened, is it dead?"
2. please submit this script to VestaCP official team so that all VestaCP users will benefit from it.

Thank you.