Installing multiple PHP versions on Rocky 9

Discussion in 'Installation/Configuration' started by jnewman67, May 27, 2025.

  1. jnewman67

    jnewman67 Active Member HowtoForge Supporter

    This is the first time I've ever had to install a different PHP version from the OS, so sorry if this seems newbie.
    I've installed the REMI repo PHP 8.0 - 8.4 versions on my system, and I'm trying to add them to the ISPConfig control panel. I need some help with the locations for things to add the version entries.
    First, if I don't assign the new version to a specific client, will it then be available to all clients?
    Second, I can't seem to find the php.ini files for the different versions. They aren't located under the /opt/remi directory where the binaries are located, and I can't find any reference to specific versions under /etc either.
    any reference to filling in all the blanks for the FastCGI, PHP-FPM and PHP-CLI for Rocky/CentOS in general would be appreciated - didn't find any specifics when searching, it was mostly Ubuntu related.
    Thanks.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I don't use Rocky Linux, so I cannot advise you on this topic.
     
  3. michelangelo

    michelangelo Active Member


    I don't use FastCGI and it is not recommended to use it anymore because FPM is superior, but I believe the FastCGI settings for Remi's PHP builds are:
    FastCGI settings:
    Code:
    Binary: /opt/remi/php<version>/root/usr/bin/php-cgi
    PHP INI: /etc/opt/remi/php<version>
    FPM settings:
    In case of systemd (so in your case), otherwise one needs to use the full path to the sysv-init service file:
    Code:
    PHP-FPM INIT Script: php<version>-php-fpm
    Path to php.ini: /etc/opt/remi/php<version>
    PHP-FPM pool directory: /etc/opt/remi/php<version>/php-fpm.d

    CLI settings:
    Code:
    PHP CLI binary: /opt/remi/php<version>/root/usr/bin/php
    Example for PHP 8.0:
    Code:
    PHP Jailkit section: php8_0
    You'll need to lookup the /etc/jailkit/jk_init.ini and how the PHP sections are named, but usually it follows the pattern php<number>_<number>



    In pictures, for example the settings for PHP 8.3 from Remi (don't mind the German):

    upload_2025-5-27_17-24-55.png

    upload_2025-5-27_17-25-25.png

    upload_2025-5-27_17-25-54.png
     
    Last edited: May 27, 2025
  4. jnewman67

    jnewman67 Active Member HowtoForge Supporter

    SO much appreciated - i'll give it a shot.
    Thanks!
     
  5. jnewman67

    jnewman67 Active Member HowtoForge Supporter

    Till,
    Can you answer this part:
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, it will be available to all clients.
     
  7. jnewman67

    jnewman67 Active Member HowtoForge Supporter

    thank you much!
     
  8. jnewman67

    jnewman67 Active Member HowtoForge Supporter

    worked like a charm :) here are some other commands that might be useful to anyone else...
    restart a specific version of PHP after you've made changes to the INI file
    Code:
    service php84-php-fpm restart
    install a specific PHP version
    Code:
    yum install php84
    install a specific PHP extension
    Code:
    yum install php84-php-mysql
    for those that need to add the new version to ISPConfig, enter this info (with version numbers changed accordingly) to each of the respective tabs
    Code:
    /opt/remi/php84/root/usr/bin/php-cgi
    /etc/opt/remi/php84
    
    php84-php-fpm
    /etc/opt/remi/php84
    /etc/opt/remi/php84/php-fpm.d
    (blank)
    
    /opt/remi/php84/root/usr/bin/php
    php8_4
    
     

Share This Page