To increase or decrease the PHP memory limit via CloudLinux Selector in Plesk, you can modify the memory settings for PHP to suit the needs of your applications. This can be done per domain or globally, depending on your server configuration.
Here's a step-by-step guide:
Step 1: Log in to Plesk
- Access your Plesk control panel by navigating to
https://your-domain.com:8443
(replaceyour-domain.com
with your actual domain or server IP address). - Enter your Plesk admin username and password to log in.
Step 2: Access PHP Settings for a Domain
- From the Plesk dashboard, go to the "Domains" section.
- Find the domain for which you want to modify the PHP memory limit and click on it.
- Under the "Web Hosting" section, click on "PHP Settings".
Step 3: Open CloudLinux PHP Selector
- On the PHP Settings page, look for the "PHP Selector" or "Select PHP Version" section.
- Click on "Select PHP Version" (this will allow you to choose the version of PHP you want to modify).
Step 4: Modify PHP Memory Limit
-
After selecting the desired PHP version, scroll down to the "PHP Settings" section, where you'll see a list of PHP directives that you can modify.
-
Locate the "memory_limit" setting. You may either find it under the "PHP Options" or "Custom PHP Settings" section, depending on your Plesk version.
- To increase the memory limit, set the value to a higher number (e.g.,
256M
,512M
, etc.):
- To increase the memory limit, set the value to a higher number (e.g.,
memory_limit = 256M
-
- To decrease the memory limit, set the value to a lower number (e.g.,
64M
,128M
, etc.):
- To decrease the memory limit, set the value to a lower number (e.g.,
memory_limit = 128M
3. If you don't see memory_limit
in the list, you can add it in the "Additional Directives" or "Custom PHP Settings" section like this:
memory_limit = 256M
Step 5: Apply the Changes
- After making the necessary changes to the memory_limit value, scroll down and click "OK" or "Apply" to save the changes.
Step 6: Verify the Changes
To verify that the memory limit has been changed, you can create a phpinfo.php
file in the root directory of your domain:
- Create a file named
phpinfo.php
and add the following code:
phpinfo();
2. Visit http://your-domain.com/phpinfo.php
in your browser.
3. Look for the memory_limit
directive in the output. It should show the new value you set (e.g., 256M
).
Step 7: Remove the phpinfo.php File (Optional)
- After confirming the changes, it's a good practice to delete the
phpinfo.php
file from your domain's root directory for security reasons.
Troubleshooting
- If you cannot find the memory_limit setting in the PHP options, ensure that you are using the correct PHP version and that you have the necessary permissions to modify PHP settings. You may need to contact your hosting provider if you do not have access to the PHP settings.
- If the memory limit is not taking effect, check for any server-wide settings (e.g., in
php.ini
or.htaccess
files) that might be overriding this directive.
By following these steps, you can easily increase or decrease the PHP memory limit for your domain using CloudLinux Selector in Plesk, providing better performance for resource-intensive applications or ensuring resource limitations to prevent overuse.