Running Multiple Different PHP Versions Simultaneously on Ubuntu 24.04

Monday, August 18th, 2025

Running Multiple Different PHP Versions Simultaneously on Ubuntu 24.04

If you need to run multiple different versions of PHP simultaneously on your Ubuntu server, it can be done.  This is needed when you want to host some legacy sites that cannot run with the breaking changes made in the newest versions of PHP (shame on you PHP for doing such nonsense). 

Here's how I did it on an Ubuntu 24.04 server which uses PHP 8.3 by default.  In this example, I have already installed and configured all web server software packages including PHP 8.3.  The EHCP Force installer can do this for you if you don't know how to install and configure everything you need to run your own web server.

Add the ondrej repo and install PHP 5.6 and 7.4:

sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt upgrade
sudo apt-get install php5.6 php5.6-fpm php7.4 php7.4-fpm
sudo apt-get install php7.4-mysql php5.6-mysql php5.6-mysqlnd-ms php7.4-gd php5.6-gd php5.6-zip php7.4-zip php7.4-cli php5.6-cli php5.6-mcrypt php7.4-mcrypt php7.4-gettext php5.6-gettext php5.6-mailparse php7.4-mailparse php7.4-imagick php5.6-imagick php5.6-curl php7.4-curl php7.4-xmlrpc php5.6-xmlrpc php5.6-imap php7.4-imap

I then adjusted the fpm php.ini files in the /etc/php/5.6/fpm/ and /etc/php/7.4/fpm directories to use custom settings that I use (optional).  I then edited the FPM pool for each version of PHP in the www.conf file in /etc/php/7.4/fpm/pool.d and /etc/php/5.6/fpm/pool.d directories to listen on a different port than PHP 8.3.  For example, for PHP 7.4, I changed the listen port to 9011.

Then, for the particular website I wanted to run under a different version of PHP, I changed the nginx template to use the corresponding port for the desired PHP FPM version like so:

location ~ \.php$ {
        root {homedir}/httpdocs;
        include fastcgi_params;
        try_files $uri = 404;
        fastcgi_pass   127.0.0.1:9011;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PHP_ADMIN_VALUE "open_basedir={homedir}:/usr/share/php:/usr/share/pear \n upload_tmp_dir={homedir}/phptmpdir \n session.save_path={homedir}/phptmpdir";
        fastcgi_read_timeout 300;
        limit_req zone=one burst=5;
    }    

Restart nginx.  The website you configured to use a specific version of PHP will be using that version now.

Open Game Panel Windows Installation Guide

Saturday, July 28th, 2012

Open Game Panel Windows Installation Guide

Open Game Panel (OGP) is a free, open source game server panel.  OGP allows server administrators to manage multiple game servers and assign users to those servers.  These users are then allowed to login and manage their rented game servers.  Users can stop, start, restart, and edit command line parameters for their servers.  FTP management is also included in the Linux version.  OGP does have a Windows version, however, it is difficult to setup.  However, this guide will walk you through everything you need to know.

General Information and Notes

  • Some links used in this guide will only work from your local server.
  • I installed ZPanelX and OGP on a Windows 7 server, and yes, they are working.
  • OGP is short for Open Game Panel, if you didn't already know.

Step 1:  Download and Install Prerequisites

Open Game Panel works in conjunction with a web hosting control panel and requires web server software.  To make this guide as simple as possible, it is recommended to install the ZPanelX package, which includes everything you'll need to run Open Game Panel.  Download both the Core and Stack ZPanelX packages here:

ZPanelX Hosting Control Panel & Software for Windows

Install the Server Stack version first, and then run the Core version to setup your web panel and login information. It's really as simple as running the installation executables and following the installation prompts.

After ZPanelX has been installed, download the SVN version of OGP from here: http://hldstart.svn.sourceforge.net/viewvc/hldstart/trunk/.  From the SVN page, just click on "Download GNU tarball".  This will download a compacted zipped file which can be open using 7-Zip or WinRar.  Extract the files.  From the extraction directory, copy the upload folder to the C:\zpanel\panel directory. Rename the folder to opengamepanel.

Open up the php.ini file located in C:\zpanel\bin\php and change the following line:

display_errors = Off

To:

display_errors = On

Keep the php.ini file open, as we'll need to change another setting after installing PEAR, a module required by OGP to run.

Step 2:  Installing PEAR For Windows

To install the PHP PEAR module for Windows, save this file containing the patched PEAR PHP installation script, and extract it to the C:\zpanel\panel directory.  Run the PEAR installation by following this URL from your LOCAL server: http://localhost/go-pear.php.  Read the prompt and go to the next page.  On the installation page under the Configuration section, you'll need to make the following changes:

For "1. Installation prefix ($prefix)", use the path of:

C:\zpanel\bin\php\pear

Keep the rest of the settings set to their default value. Click Install. After PEAR has been successfully installed, go back to your php.ini file and find your include path:

Change:

; include_path = ".;C:\php\includes;"

To:

include_path = ".;C:\zpanel\bin\php\pear\PEAR;"

Save your PHP.ini file. Now, before your changes will take effect, you must restart the Apache daemon. Do this by going to Start –> All Programs –> ZPanel –> Management –> Apache Monitor

When the Apache monitor loads, click Stop, and then click Start.

Step 3:  Creating Database and Users:

Login to ZPanel using your login and password that was created during ZPanelX installation. Under Database Management, click on MySQL Database. Create a new database with any name. Once the database has been created, go back to the main Admin page. Under Database Management, click on MySQL Users. Assign a user to the database you just created… this will be the login and the user's password will be generated after assigning the user to a database. Save the database name, login, and password, as you will need these values when installing OGP.

Start the installation of OGP from your LOCAL server:

Start OGP Install

After installing OGP, it's time we installed the Windows server agent program:

Windows OGP x64 Agent Install DownloadWindows OGP x86 Agent Install Download – (Create an account and login before you can access the download!)

Install the OGP Windows Agent program.  Run the agent_stop.bat file in the OGP installation directory after the installation has finished to stop OGP.  To run OGP without using the service account, simply use these agent start and stop scripts instead.

Start the agent. Login to OGP, create a server, use the encryption key you just created, and for the username use your Windows username.

The server should be added successfully and show up as online.  You can now setup and administrate game servers on your Windows server!