Author Topic: Changing from PHP-CGI to PHP-FPM per account from the command line  (Read 758 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Does anyone know if there is a way to do the following via command line on CWP servers:

- Change the PHP version for an account from PHP-CGI handler to PHP-FPM handler so that the /opt/alt/php-fpm$phpfpmver/usr/etc/php-fpm.d/users/*.conf files are generated and used for PHP processes and not CGI.
- In the user panel this can be accomplished by using the PHP Selector, select the domain, then see what PHP version is being used (ex. PHP selector 7.3), then change to PHP-FPM variant, Update.

There does not appear to be any form of Admin API or scripts I can find that can accomplish this...

Offline
*****
Re: Changing from PHP-CGI to PHP-FPM per account from the command line
« Reply #1 on: April 05, 2024, 03:11:24 PM »
Whenever I enable a new version of php for use with php-fpm, I copy the previous version's $USER conf to the new version, updating the paths therein to correctly reflect the version.
Code: [Select]
/opt/alt/php-fpm$VERSION/usr/etc/php-fpm.d/users/

Offline
*
Re: Changing from PHP-CGI to PHP-FPM per account from the command line
« Reply #2 on: April 06, 2024, 06:54:47 AM »
I tried that by mimicking what happens in this script more or less:
Code: [Select]
/scripts/phpfpm_rebuild_user_conf
However, after creating that file, the version remains the same on the user interface. Rebuilding user configs etc also does not do the trick.

So I am guessing there is more than one place the panel gets the PHP selector data from in addition to those config files.