If you’re running CloudLinux and find that the default PHP limits (such as memory or upload size) are insufficient, there are a few ways to address this.
For individual accounts, limits can be adjusted by placing a custom php.ini file inside the account’s public_html directory (and the wp-admin directory if WordPress is in use).
However, if you need to apply a server-wide default for the native PHP version, this can be done by modifying the global PHP configuration used outside of CloudLinux PHP Selector.
This method applies only to the system (native) PHP binary.
It does not affect PHP versions managed via CloudLinux PHP Selector, which are each configured separately.
Modifying the global php.ini file
Edit the system php.ini file, located in /usr/local/lib
Modify the following common settings according to your requirements:
max_execution_time = 300memory_limit = 128Mupload_max_filesize = 128Mpost_max_size = 128M
Ensure post_max_size is equal to or greater than upload_max_filesize. Otherwise, file uploads may fail.
Once the changes have been saved, rebuild the CageFS environment to ensure they are applied consistently for all users:
cagefsctl --force-update
The updated PHP limits will now apply server-wide to the native PHP version, including within CageFS.
For environments using PHP Selector, PHP limits should instead be adjusted via one of the following utilities:
CloudLinux PHP Selector
cPanel’s MultiPHP INI Editor