How to increase memory limit using .htacess

Issue:

You might have encountered cannot access to your website with error related to memory exhausted and system try to reserve memory with certain memory allocations.

Solutions:
  1. Login to your cPanel and click on File Manager.
  2. It will open a new window to confirm that you are going to open a File Manager window. Make sure you have selected "show hidden files"
  3. In the File Manager window, go to public_html folder and select .htaccess file.
  4. Click edit button on the top of the File Manager and will open a new window which allow you to edit .htaccess file.
  5. Add below line.
    php_value memory_limit 1024M
  6. You may change the value according to your application need.
  7. Once done, you need to click on the save button.
  8. You should be able to solve the issue.
Affected Application:

Joomla: may require 2048M to allow it to works.
Others: may work with 500M


Was this answer helpful?

Also Read

Failed to upload image or file to wordpress

Issue:There will be possibilities where you will not be able to upload any images or files to...

Turn On/Off Directory Browsing

For Linux server: Turn on Directory Browsing -create a .htaccess file in the specific directory...

Page is displaying 404 Page Not Found error

The 404 Page Not Found error means that the user requested a page on the server that does not...

My webpage is displaying ads

If your website is not pulling up and is instead showing advertisements, the most likely cause is...

Cannot connect to database

This error will occur within a web application when any of the following conditions are met:...