The best toolkit for DirectAdmin

Set default PHP version for new domains on DirectAdmin

You can easily set the default PHP for new domains using Suspenders by using a small hook script to set the default PHP version after a domain is created.

The example below will set the default PHP version to 8.3. You must leave the $domain value as-is, since it uses an environment variable from the system for the current domain.


#!/bin/sh
# This file is located at:
# /usr/local/directadmin/scripts/custom/domain_create_post/10-set-default-php

/usr/local/bin/sus domain:update --php-version=8.3 $domain
  

Ensure that you set the file executable with chmod.

chmod +x /usr/local/directadmin/scripts/custom/domain_create_post/10-set-default-php