Skip to main content

How to Increase the PHP Memory Limit for One Website

You can increase the PHP memory limit for a specific website to allow it to process larger tasks, such as installing plugins or processing large images. This procedure is performed by a customer with access to the website's hosting control panel.

You can increase the PHP memory limit for a specific website to allow it to process larger tasks, such as installing plugins or processing large images. This procedure is performed by a customer with access to the website's hosting control panel.

Before you begin

You will need:

  • Access to your hosting control panel (such as cPanel or Windows Control Panel)

  • The specific website's domain or account information

Adjusting the PHP Memory Limit

The method for increasing the memory limit depends on the type of hosting environment you are using.

For Linux-based hosting (cPanel)

  1. Log in to your hosting control panel.

  2. Locate and open the Select PHP Version or MultiPHP INI Editor tool.

  3. Select the specific domain or account you wish to modify.

  4. Locate the memory_limit setting in the list of PHP variables.

  5. Change the value (e.g., from 128M to 256M or 512M).

  6. Click Save or Apply to update the configuration.

For Windows-based hosting (Windows Control Panel)

  1. Log in to the Windows Control Panel.

  2. Navigate to the PHP Settings or PHP Manager section.

  3. Select the specific website or application.

  4. Locate the memory_limit directive in the configuration list.

  5. Update the value to your desired limit (e.g., 512M).

  6. Click Save or Apply.

Confirm the result

To verify that the change has been applied, you can use a PHP information script:

  1. Create a file named info.php in your website's root directory.

  2. Add the following code to the file:

    <?_php
    phpinfo();
    ?>

  3. Open the file in your browser by navigating to http://example.com/info.php.

  4. Locate the Loaded Configuration File or PHP_OPTIONS section to find the memory_limit value.

  5. Once confirmed, delete the info.php file from your server for security.

Limitations

  • The maximum allowable memory limit may be restricted by your specific hosting plan.

  • If you are using a Content Management System (CMS) like WordPress, some plugins may have their own internal limits that are independent of the server's PHP configuration.

  • Changes to PHP settings may take a few moments to propagate across the server.

Did this answer your question?