Home » Php » php – increase memory limit on wamp

php – increase memory limit on wamp

Posted by: admin July 12, 2020 Leave a comment

Questions:

I have wamp64 and php version 5.6.16 and apache 2.4.17. I have a 4gb ram win7 pc

I am running a cakephp project and keep getting an error when displaying rows from a table

Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4145278 bytes)

To increase the memory there is no php.ini so I changed the memory_limit = 2048M in php-production.ini NOt sure if I edited the correct file.

This has no effect as i still get the same error. Am I able to increase the memory limit and do I do this in which file? I seem to be stuck on this amount of memory 134217728

I didnt make sense of past replies on the topic as the php.ini doesnt exist in this wamp

How to&Answers:

The php.ini file usually is on “C:\wamp64\bin\php\php_ver” where “php_ver” is the version of the PHP you are using (please note the latest version of wamp includes two version of PHP, make sure you edit the right php.ini file)

then on line 397 you can find memory_limit = 128M

change it, save it, and restart the services.

Answer:

I go to php-production.ini files and change the memory their. Not sure if thi is the best way but I couldnt rename the php.ini file and no one else had a better idea either