I installed Magento on WAMP Server and I have PHP Fatal error:

  Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to allocate 262144 bytes)

I tried to increase memory_limit to 1G in:

1) Wamp Server -> PHP -> php.ini

2) .htaccess in magento root folder

3) .user.ini in magento root folder

but it still doesnt work.

I also tried

  ini_set('memory_limit', '2048M');

in php file but it doesnt affect memory limit to.

When I run phpinfo() in magento root folder it shows memory limit master value 1G but local value still 768M.

How can I force magento to increase that memory limit?

  • It does means you must have defined something which is working infinite or your code may have printed a large object.
    – Kumar M
    Commented Jan 23, 2018 at 18:39
  • Maybe you are right but this is not a point. 768M is deafult memory size limit and magento documentation recommends to set it to 1G or even higher than that. Im trying to change that value in different ways but magento still forced to its default 768M
    – Tabart
    Commented Jan 23, 2018 at 18:55
  • Refer this link.
    – Pratik Oza
    Commented Jan 23, 2018 at 19:21

1 Answer 1


Just clear "Var" folder in magento root directory, then Delete all files from static folder except .htaccess file. Please dont delete .htaccess file in static folder. You can find Static folder in magento root directory "pub" folder.

Then restart your server once.

You site will come back.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.