How to increase or decrease PHP Memory Limit via CloudLinux Selector in Plesk? (Video)

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 (replace your-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

  1. From the Plesk dashboard, go to the "Domains" section.
  2. Find the domain for which you want to modify the PHP memory limit and click on it.
  3. Under the "Web Hosting" section, click on "PHP Settings".

Step 3: Open CloudLinux PHP Selector

  1. On the PHP Settings page, look for the "PHP Selector" or "Select PHP Version" section.
  2. 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

  1. 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.

  2. 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.):

                   memory_limit = 256M

    • To decrease the memory limit, set the value to a lower number (e.g., 64M, 128M, etc.):

                   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:

  1. Create a file named phpinfo.php and add the following code:

         <?php

         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.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Change the PHP Version via CloudLinux Selector in Plesk? (Video)

Changing the PHP version via CloudLinux Selector in Plesk is a straightforward process. Here’s...

How to Enable ionCube Loader using CloudLinux Selector in Plesk? (Video)

Enabling ionCube Loader on your server via CloudLinux Selector in Plesk is a simple process....

How to Enable the GD extension of PHP using CloudLinux Selector in Plesk? (Video)

Enabling the GD extension for PHP using CloudLinux Selector in Plesk is a straightforward...

How to Enable the Mailparse Extension of PHP Using CloudLinux Selector in Plesk? (Video)

To enable the Mailparse extension for PHP using CloudLinux Selector in Plesk. Follow these...

How to Enable or Disable PHP Extensions Using the CloudLinux Selector in Plesk? (Video)

Enabling or disabling PHP extensions via the CloudLinux Selector in Plesk is an easy and...