Development

PHP version select with Directadmin

Choosing and enabling multiple PHP versions with the selector in the Directadmin panel.

Directadmin allows up to 4 active PHP versions to be used and chosen from. The first listed is default and the rest will be options.

Navigate to Directadmin custombuild directory

cd /usr/local/directadmin/custombuild

Update or check for updates to Directadmin

./build update

Now choose the 4 PHP versions you want to use:

./build set php1_release 7.1
./build set php2_release 7.3
./build set php3_release 7.4
./build set php4_release 8.0

I am going to be doing it sequentially for this post, remember the first listed (php1_release) is the default.

If you don’t want 4 options use “no” e.g

./build set php4_release no

Now set the mode as php-fpm

./build set php1_mode php-fpm
./build set php2_mode php-fpm
./build set php3_mode php-fpm
./build set php4_mode php-fpm

Rebuild PHP

./build php n

And the rewrite configurations

./build rewrite_confs

The PHP version select option is enabled by default, to make sure it is enabled:

/usr/local/directadmin/directadmin set php_version_selector 1 restart

Now in modify domains the users have the PHP version selector.

 

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

1 year ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

1 year ago

FTP getting array of file details such as size using PHP

Using FTP and PHP to get an array of file details such as size and…

2 years ago

Creating Laravel form requests

Creating and using Laravel form requests to create cleaner code, separation and reusability for your…

2 years ago

Improving the default Laravel login and register views

Improving the default Laravel login and register views in such a simple manner but making…

2 years ago

Laravel validation for checking if value exists in the database

Laravel validation for checking if a field value exists in the database. The validation rule…

2 years ago