How to add a custom PHP version in Plesk for Linux?

Follow

Comments

12 comments

  • Avatar
    Cyril Thibout (Edited )

    Hi
    Followng this article (and some additional help from https://talk.plesk.com/threads/unable-to-start-service-unable-to-manage-service-by-phpinimng.369863/)  I was able to add and run PHP 7.1 (FPM) on a Plesk Obsidian 18.0.52 update3 (Debian 11.7).

    However in the Plesk Tools&Settings / PHP settings / 7133-phpfpm page the EXTENSION TAB remains empty
    Whatever I write in the PHP.ini (the second tab) phpinfo shows me that mysqli is not loaded.

    I tried to add the following lines without success:

    extension=msql.dll
    extension=msql.so
    extension=mysqli
    extension=php_mysqli
    extension=php_mysqli.dll

    Maybe the solution was to compile the PHP 7.1 WITH the extensions as I could understand it on your § 1.4 but then what is the right syntax to add mysqli please?

     

    I tried without success:

    ./configure --prefix /usr/local/php-7.1.33 --enable-fpm --with-fpm-group=www-data  --enable-soap --with-mysqli --with-mysql-sock


    thanks for your help

     

    Cyril

    0
    Comment actions Permalink
  • Avatar
    Alexander Tsmokalyuk

    @Cyril this requires investigation, please create a ticket to Plesk Technical support

    0
    Comment actions Permalink
  • Avatar
    Cyril Thibout

    Alexander-Tsmokalyuk

    Yes I already created https://talk.plesk.com/threads/custom-php-7-1-with-extensions.370131/

    thanks

    0
    Comment actions Permalink
  • Avatar
    anton.mozolkov (Edited )

    Hi, did you manage to solve the problem?

    we are experiencing the same difficulty after installing the PHP version following instructions from Plesk....

    0
    Comment actions Permalink
  • Avatar
    anton.mozolkov

    I'll leave it here:

    ./configure --prefix /opt/plesk/php/7.2 --enable-fpm --with-fpm-group=www-data --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd

    after that in info.php mysqli and pdo_mysql appeared, I didn't do anything in php.ini.

    I think the situation is the same with other extensions. An example of installation can be taken from the "Configure Command" section of any version of PHP available for installation and in the Plesk panel.

    0
    Comment actions Permalink
  • Avatar
    J L

    Hi,

    Followed this article, however, Im stuck by point 2 further down it says:

    • -service <PHP FPM service name>: It's the PHP FPM service name

    What do I actually put as the service name? It doesn't take spaces and simply PHP-FPM errors out 'service not found'.

     

    Appreciate any clarification

     

    0
    Comment actions Permalink
  • Avatar
    Alexander Tsmokalyuk

    Hi J L

    The service name can be  fpm5.6-custom or 5.6fpm, you can name the service according to your preference. White spaces are not allowed, indeed. I will update the instructions accordingly. 

    0
    Comment actions Permalink
  • Avatar
    J L (Edited )

    Thanks Alex.

    As suggested, I ended up doing just "fpm" as the service name and it was registered successfully.

     

    JL

    0
    Comment actions Permalink
  • Avatar
    bernhard

    Hello, I followed the instructions but stuck with
    plesk bin php_handler --add -displayname 5.6.40-custom -path /usr/local/5.6.40/bin/ -phpini /usr/local/lib/php.ini -type fpm -id 5.6.40-custom -clipath /usr/local/5.6.40/bin/ -service fpm5.6-custom -poold /usr/local/5.6.40/etc/

    Message: 7583:65f709c00831b ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/php_handlers_control' '--add' '--path' '/usr/local/5.6.40/bin/' '--phpini' '/usr/local/lib/php.ini' '--type' 'fpm' ' --displayname' '5.6.40-custom' '--id' '5.6.40-custom' '--clipath' '/usr/local/5.6.40/bin/' '--service' 'fpm5.6-custom' '--poold' '/usr/local/5.6.40/etc/'] with exit code [1]
    Unable to register the PHP handler: can not get version from /usr/local/5.6.40/bin/

    Any idea what I did wrong

    0
    Comment actions Permalink
  • Avatar
    Del Corso (Edited )

    bernhard

    plesk bin php_handler --add -displayname 5.6.40-custom -path /usr/local/5.6.40/bin/xxxx -phpini /usr/local/lib/php.ini -type fpm -id 5.6.40-custom -clipath /usr/local/5.6.40/bin/yyyy -service fpm5.6-custom -poold /usr/local/5.6.40/etc/ 

    xxxx is the name of the fpm binary (ex. php-fpm) 
    yyyy is the name of the cli binary (ex. php56)


    0
    Comment actions Permalink
  • Avatar
    Steven Petrillo

    Hello all...

    Here is my 5.6 command line and I am not sure what I have wrong:

    plesk bin php_handler --add -displayname 56-custom -path /usr/local/php56/sbin/php-fpm -phpini /usr/local/lib/php.ini -type fpm   -id 56-custom -clipath /usr/local/php56/bin/ -service fpm56 -poold /usr/local/php56/etc/

    0
    Comment actions Permalink
  • Avatar
    Del Corso

    Steven Petrillo 

    -clipath /usr/local/php56/bin/yyyy

    yyyy is the name of the cli binary (ex. php56)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request