I’ve been trying to increase the php memory_limit in MAMP (Mac OSX). The version of PHP I’m using is 126.96.36.199. I’ve read about creating a new template for MAMP Pro, but I’m using the standard version of MAMP.
I’ve tried all of the below, but nothing seems to have worked. Any help would be much appreciated.
Thank you for your time.
I’ve added the following to my site’s htaccess file, which is read by the site and works (ExpressionEngine). But the master PHP limit is still not updating.
php_value memory_limit 128M
I’ve changed the following from 32M to 128M in the following file:
memory_limit = 128M ;
I then quit MAMP entirely and restarted it, but in MAMP phpInfo it still reads:
I am using Virtual Hosts to set my own URLs. I read somewhere that it may be necessary to increase the memory limit here. So I added this to the ‘php_value memory_limit 128M’:
<VirtualHost *:80> DocumentRoot /Applications/MAMP/htdocs ServerName localhost php_value memory_limit 128M </VirtualHost>
and lower down in the same file in the relevant site’s configuration:
<VirtualHost *:80> DocumentRoot "/Users/Username/Dropbox/Dev/sitename.dev" ServerName sitename.dev php_value memory_limit 128M </VirtualHost>
(By the way, I keep my MAMP folder (Dev) in Dropbox and it works fine)
I also added a php.ini file with the following contents in both the root of my site directory and the root of my MAMP directory:
memory_limit = 128M
Managed to solve it 😉
The correct one is:
find ‘memory_limit’ and increase the number:
memory_limit = [number]M
phpinfo.php and put there the
phpinfo(); in the output you can see the loaded configuration files and the values.
Edit the loaded php.ini file and set the memory limit. I think you have edited the wrong php.ini file or your application set the value over
In Mamp Pro and PHP version 7.2.8 ,you can find configuration file in this path:
But according to
phpinfo(); My loaded configuration file is in different path! It is here:
/Library/Application Support/appsolute/MAMP PRO/conf/php7.2.8.ini
Also don’t forget restart Mamp Pro.
Coming here after facing the same problem with PHP v.7.2. To fix this I needed to go to the path /usr/local/etc/php/7.2/conf.d/php-memory-limits.ini and change the following:
; Max memory per instance memory_limit = 2048M
Anything else I tried would not change it.
Now I don’t get this errors when trying to pull packages with composer in my projects (Fatal error: Allowed memory size of 536870912 bytes exhausted…)
I was able to set memory_limit with MAMP PRO 5.5 on MacOS here :
PHP mode is Individual PHP version for every host (CGI mode)
I have been chasing this for a couple hours, trying to scrub through all my
php.ini files trying to update the settings with a text editor and saving it. And every time I’d restart MAMP the settings would get changed back and the file would be overwritten. So here’s how I did it where I finally didn’t get overwritten by MAMP.
In MAMP, use the menu to get to version of PHP you are using. Mine is 7.3.1 at this time.
MAMP > File > Edit Template > PHP(php.ini) > 7.3.1
- An editor window will open, then use the search bar to find your setting…
- Update your setting
- Cmd + S then close the editor window OR just close the editor window and click “Save” when you are prompted
- MAMP will then automatically re-start the servers with the new settings