Adding PHP v7.1 to DA server with v7.2 already installed?

jlpeifer

Verified User
Joined
Jun 6, 2006
Messages
97
Howdy,

I just finished installing DA onto a new server and chose to install PHP version 7.2. Shortly after moving all my client's sites to the new server I received a complaint/request to install PHP version 7.1. Apparently a customer is using a script that's not compatible with 7.2.

I've found instructions on how to enable multiple PHP versions on a server, but am hesitant to plow forward with this process for fear that I might break something.

Here are the instructions.

Am I safe to follow this guide, or will I break things? Any input would be greatly appreciated!
 
Just a quick follow-up for anyone finding this thread in the future. The process described on the aforementioned website seems to have worked successfully. In summary, here are the commands I used:

Code:
cd /usr/local/directadmin/custombuild
./build set php1_mode php-fpm
./build set php2_mode php-fpm
./build set php1_release 7.2
./build set php2_release 7.1
./build php n
./build rewrite_confs

Last step was to select a PHP version for the customer via DA control panel.
  1. Show All Users --> UserName --> Login as UserName --> Domain Setup --> Select Domain
  2. At bottom choose PHP 7.1 php-pfm as "First PHP" and PHP 7.2 php-pfm as "Second PHP"
  3. Save

I didn't time the process, but would guess it took about 15 minutes to recompile everything needed. Probably best to do this on off-hours if you're planning on doing something similar.

Side-Note: This method did break a site which had some custom PHP variables set in .htaccess. To resolve the issue I used the following guide to set per-user PHP settings... https://help.directadmin.com/item.php?id=672. After making changes I need to restart the php-fpm72 service in order for the custom settings to be recognized. Your Mileage May Vary depending on the PHP mode you are using.
 
Last edited:
Back
Top