How to increase the PHP Memory limit using .htaccess?

By default, a PHP script can allocate up to 128 megabytes of memory. You can modify this limit by changing the memory_limit directive in an .htaccess file.

To change the PHP memory limit, follow these steps:

  1. Login to cPanel
  2. Then go to File Manager from cPanel.

  3. Now go to your document root and open .htaccess file by right click. Then click on the “Edit”

  4. Now put the following code. Replace xxx with the new memory limit value that you want to set, in megabytes:

php_value memory_limit xxxM

Save the changes to the .htaccess file and exit the text editor.

To verify that the new setting is active, create a PHP test file that contains the following code in the same directory where the .htaccess file is located:

<?php phpinfo(); ?>
  • 0 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

How to recover a lost cPanel Password?

If you lost your cPanel password or the one provided in the welcome email does not work, you can...

How to change PHP version from cPanel?

D-WEBHOST is using Cloudlinux for Security and Stability. Cloudlinux has a great feature that...

How to enable or disable allow_url_fopen in cPanel

Sometimes, few application required allow_url_fopen need to be on. As allow_url_fopen is managed...

How to disable directory listing in cPanel?

The LiteSpeed web servers default behaviour allows users visiting your website to see the...

How to add new domain to existing hosting package ?

Login to cPanel. You can do that from the details in your email sent by d-Webhost or from...