How to increase memory limit using .htacess


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.

  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

How to use PostgreSQL by using cPanel

PostgreSQL is an open source Relational Database Management System(RDBMS). First, Enter the...

How much hosting do I need?

If you are starting your first website, chances are you are not familiar with common hosting...

What is hotlink protection?

Hotlink protection is disabling external use of your resources. For instance, if your website has...

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

My images are broken, or don't show up!

Firstly, check to see whether they are uploaded to our server and are in the correct...