Page 3 of 17

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Wed Sep 26, 2018 4:21 am
by mericson
I followed this step-by-step on Ubuntu 18.04, and didn't get a single error. I only had to change the repository at the beginning of the tutorial.

Unfortunately, the switcher only works for PHP 7.2 all the other versions do not create the properly named socket. I believe that PHP 7.2 may have already been installed for VestaCP, but of course, the FPM templates are new with this tutorial

When I accesss my site while switched to PHP-FPM-56 I get the error:

[Wed Sep 26 03:55:44.698325 2018] [proxy:error] [pid 12486] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php5.6-fpm-mydomain.com.sock (*) failed
[Wed Sep 26 03:55:44.698424 2018] [proxy_fcgi:error] [pid 12486] [client 159.65.252.229:35342] AH01079: failed to make connection to backend: httpd-UDS

In /run/php/ I do see php7.2-fpm-mydomain.com.sock and php7.2-fpm-mydomain.com.sock and I see php5.6-fpm.sock but not one with mydomain.com for php5.6. I have no idea where this is failing so need some help!

Is there a chance that these new configs only work for new domains? Is there an additional step I must perform for existing domains? I tried v-rebuild-web-domain mydomain.com restart but nothing changed.

Thanks,
Mark

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Mon Oct 08, 2018 3:51 pm
by tom256
Great Tutorial, this kind of selector should be implemented in VestaCP by default

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Mon Oct 08, 2018 7:58 pm
by mericson
mericson wrote:
Wed Sep 26, 2018 4:21 am
I followed this step-by-step on Ubuntu 18.04, and didn't get a single error. I only had to change the repository at the beginning of the tutorial.

Unfortunately, the switcher only works for PHP 7.2 all the other versions do not create the properly named socket. I believe that PHP 7.2 may have already been installed for VestaCP, but of course, the FPM templates are new with this tutorial

When I accesss my site while switched to PHP-FPM-56 I get the error:

[Wed Sep 26 03:55:44.698325 2018] [proxy:error] [pid 12486] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php5.6-fpm-mydomain.com.sock (*) failed
[Wed Sep 26 03:55:44.698424 2018] [proxy_fcgi:error] [pid 12486] [client 159.65.252.229:35342] AH01079: failed to make connection to backend: httpd-UDS
I was able to solve this issue by repeating the step of the tutorial that configured PHP 5.6. After repeating that step, PHP 5.6 is available in my selector. I too appreciate this tutorial, and hope it or something similar can be part of the default installation!

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Sat Oct 20, 2018 8:38 am
by chrisf
Works perfectly on Ubuntu 18.04, the only change is the first step.

Code: Select all

add-apt-repository ppa:ondrej/php
a2enmod proxy_fcgi setenvif
The commands all expect root, so

Code: Select all

su root
The rest you do verbatim. I made a few adjustments, and added a default.sh to remove you from any pool.

Another modification I made was in the *.sh file, copy the default php/x.x/php.ini to the /home/user/web/domain - this way each domain can have it's own php.ini - and you have to let the pool know to load it :-)

I would really like to add the fpm services under the server tab, so I can restart from the UI. Is there any easy way to do this?

Chris

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Sun Oct 21, 2018 5:39 am
by mehargags
Chris,
you can comment for this on bugtracker or GIT

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Mon Oct 22, 2018 10:57 am
by dpeca
mehargags, this is not a part of vestacp so he can not do anything on git or bugtracker :)

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Tue Nov 20, 2018 2:51 pm
by maniek015
Who know's how I can on Debian 9 and newest VestaCP with PHP Selector change the default version of PHP?

PhpMyAdmin have a problem with PHP 7.2 so I want to change it to PHP 7.1. "php -v" says me I used PHP 7.2 on the server default.

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Tue Nov 20, 2018 3:22 pm
by dpeca
maniek015 wrote:
Tue Nov 20, 2018 2:51 pm
Who know's how I can on Debian 9 and newest VestaCP with PHP Selector change the default version of PHP?

PhpMyAdmin have a problem with PHP 7.2 so I want to change it to PHP 7.1. "php -v" says me I used PHP 7.2 on the server default.

rm /etc/alternatives/php
ln -s /usr/bin/php7.0 /etc/alternatives/php

but it will not affect apache php module at all..
you probably need to create some subdomain and leave it to default 'hosting' or 'default' template (so, because of it - it will use default php 7.0 version) and then point your browser to http://created-sub.domain.com/phpmyadmin/

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Wed Nov 21, 2018 6:42 am
by maniek015
Thank you dpeca - it work properly :)

I have another problem - on default PHP 7.0 the problem not show - on the all FPM PHP I have a problem with mod_rewrite detect. Script not see the mod_rewrite - when I switch to "default" template (PHP7.0) script see the mod_rewrite.

Anyone have a idea where is the problem?

Re: TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1 and 7.2 for Debian (and optionally make direct nginx <-> PHP-FPM stack)

Posted: Wed Nov 21, 2018 8:54 am
by dpeca
maniek015 wrote:
Wed Nov 21, 2018 6:42 am
I have another problem - on default PHP 7.0 the problem not show - on the all FPM PHP I have a problem with mod_rewrite detect. Script not see the mod_rewrite - when I switch to "default" template (PHP7.0) script see the mod_rewrite.

Anyone have a idea where is the problem?
You are not pointing nginx directly to php-fpm, as it is described in second post of this thread, right?