Question
How to set PHP INI options?
Answer
If you are only trying to resolve issues with your individual cPanel site, you can adjust a subset of PHP.ini values via cPanel's "MultiPHP INI Editor." The "Basic Mode" allows you to edit the most common PHP options, while "Editor Mode" allows you to set most options by editing the php.ini itself.
- Log in to cPanel.
- Navigate to "cPanel / Software / MultiPHP INI Editor."
- In "Basic Mode," choose your domain from the dropdown menu to load and view your current settings.
- Make any adjustments, such as to "memory_limit," then click "Apply" at the bottom of the page.
- If an option is not available in "Basic Mode," the "Editor Mode" can be used to make advanced configuration changes to your sites.
Note: If the "Editor Mode" is blank, click "Apply" from the "Basic Mode" screen first to create the php.ini file in your document root.
If you're making changes to the system-wide PHP settings or want to disable a feature outright, such as PHP's exec() function, you'll want to utilize WHM's "MultiPHP INI Editor" instead of cPanel.
- Log in to WHM.
- Navigate to "WHM / Software / MultiPHP INI Editor."
- In "Basic Mode," choose your desired PHP version from the dropdown menu to load and view your current settings.
- Make any adjustments, such as to "memory_limit," then click "Apply" at the bottom of the page.
- If an option is not available in "Basic Mode," the "Editor Mode" can be used to make advanced configuration changes to each PHP version.
Each installed PHP version will have its own php.ini file. Admins or SSH users can modify the files manually. Each PHP version is installed within "/opt/cpanel/" under their own respective "ea-phpXX" directories:
/opt/cpanel/ea-phpXX/root/etc/php.ini
For example, PHP 8.1 uses the following path:
/opt/cpanel/ea-php81/root/etc/php.ini
If PHP-FPM is in use, restart it after making any changes to these files:
/scripts/restartsrv_apache_php_fpm
# Additional Resources
For more information about these views, please see our documentation:
MultiPHP INI Editor for cPanel | cPanel Docs
MultiPHP INI Editor for WHM | cPanel Docs
Comments
0 comments
Article is closed for comments.