Best Practices for Applying Custom PHP Settings per Domain in Direct Admin

davidjames829

New member
Joined
Jul 8, 2025
Messages
1
Hi Community,


I’m looking for insights on the best practices for configuring custom PHP settings for specific domains in DirectAdmin, as I’ve noticed inconsistent application in some setups. I’d love to hear how others manage this for their hosting environments.


Details:


  • Setup: DirectAdmin (latest version as of July 2025, Evolution skin), CentOS 7, CustomBuild 2.0, PHP 8.1 (php-fpm mode), hosting multiple client domains.
  • Context: I’m using Admin > Custom HTTPD Configurations to set custom PHP directives (e.g., upload_max_filesize=50M, post_max_size=50M) for a specific domain via the php-fpm81 configuration. The settings are added in the |CUSTOM| token for the domain’s virtual host.
  • Observation: The custom PHP settings sometimes don’t apply consistently across domains, especially after CustomBuild updates or server restarts. I’ve checked the PHP Info page for the domain, and default settings (e.g., upload_max_filesize=2M) occasionally persist.
  • Steps Taken:
    • Added customizations via Admin > Custom HTTPD Configurations, saved, and restarted httpd/php-fpm.
    • Verified syntax in /usr/local/directadmin/data/users/<user>/php/php-fpm81.conf.
    • Reviewed DirectAdmin’s Custom HTTPD guide (https://docs.directadmin.com/webservices/apache/custom-httpd.html).
    • Ensured no conflicting settings in /usr/local/directadmin/custombuild/configure/fpm/conf/php-fpm.conf.81.
  • Goal: Understand reliable methods to ensure custom PHP settings apply consistently per domain without being overridden.

Questions:


  • What are your go-to methods for managing per-domain PHP settings in DirectAdmin (e.g., Custom HTTPD vs. custom php.ini)?
  • Are there best practices to prevent CustomBuild updates from resetting custom PHP configurations?
  • Any tips for validating that custom PHP settings are applied correctly (e.g., specific logs or CLI commands)?
  • How do you handle multi-PHP setups (e.g., PHP 7.4 and 8.1) to avoid conflicts in custom settings?

I’d appreciate any community insights or recommended approaches to streamline this process! Thanks in advance.


Cheers,
David James
 
I’d appreciate any community insights or recommended approaches to streamline this process! Thanks in advance.
If possible, I would step away from Centos 7 since this is an EOL OS and not supported anymore.
Unless you really need some ancient PHP versions not supported by newer DA versions or if you're running Cloudlinux.
 
Anything older than 5.6 is no longer supported by DirectAdmin even on CentOS 7
Centos 7 is not supported by DA anyway anymore as it's passed it Directadmin EOL date (september 2024).
Except maybe the DA binary, but not the OS.

Which is why I mentioned Cloudlinux as this is the only thing which also supports security fixes for ancient (read: EOL) PHP versions, DA does provide installation support for older PHP but no security updates, neither does the OS. Only Cloudlinux does.

So that is why I advised to upgrade the OS and then ofcourse also the php versions can be updates best too, to non-EOL versions.
 
Back
Top