Get the most out of your Centmin Mod LEMP stack
Become a Member

PHP Multiple PHP Versions on Same Server

Discussion in 'Nginx and PHP-FPM news & discussions' started by skringjer, Aug 13, 2024.

Tags:
  1. skringjer

    skringjer NoobMaster69

    208
    26
    28
    Apr 21, 2019
    Ratings:
    +43
    Local Time:
    12:24 AM
    Nginx 1.21.6
    MariaDB 10.3.x
    Greetings everyone, i am hosting different apps on the server and some can only run on older php while some can only run on newer versions.

    I found this thread to use multiple php on the same server, i have installed php8.2 using this guide.


    GitHub - centminmod/centminmod-php71: testing concurrent PHP (php-fpm) version install for centminmod.com LEMP stacks on CentOS 7 only

    But i dont know how to make my vhost use this 8.2 version, can anyone please help.
     
  2. skringjer

    skringjer NoobMaster69

    208
    26
    28
    Apr 21, 2019
    Ratings:
    +43
    Local Time:
    12:24 AM
    Nginx 1.21.6
    MariaDB 10.3.x
    Sorry i found it, its mentioned in the guide.
     
  3. skringjer

    skringjer NoobMaster69

    208
    26
    28
    Apr 21, 2019
    Ratings:
    +43
    Local Time:
    12:24 AM
    Nginx 1.21.6
    MariaDB 10.3.x
    Now how can i make composer / laravel use this new php :D
     
  4. skringjer

    skringjer NoobMaster69

    208
    26
    28
    Apr 21, 2019
    Ratings:
    +43
    Local Time:
    12:24 AM
    Nginx 1.21.6
    MariaDB 10.3.x
    Fixed that too

    php82 /usr/local/bin/composer create-project laravel/laravel myproject --prefer-dist


    Centmin is so powerful thanks alot @eva2000 amazing job


    Running php 7 as global for my other vhost, and php82 for my specific vhost thats running laravel 11
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,555
    12,223
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,792
    Local Time:
    5:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Ah have not tested that experimental code and setup in a long time but glad to here it works. Just note for each php-fpm version you install, your overall php memory usage will increase. So ensure you do have enough memory
     
  6. skringjer

    skringjer NoobMaster69

    208
    26
    28
    Apr 21, 2019
    Ratings:
    +43
    Local Time:
    12:24 AM
    Nginx 1.21.6
    MariaDB 10.3.x
    It works perfect, Yes i read that part about memory usage, i have a very good server with good memory so no issues there.
     
  7. Sysnet

    Sysnet New Member

    8
    0
    1
    Nov 17, 2020
    Ratings:
    +0
    Local Time:
    2:24 PM
    Hi, I curious if this also apply to "nginx unit" ?
    because the functionality is different
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,555
    12,223
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,792
    Local Time:
    5:24 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    In theory it would if all web apps utilising all the different PHP versions at the same time.