I've been trying to increase the php memory_limit in MAMP (Mac OSX). The version of PHP I'm using is 5.4.1.0. 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.
php_value memory_limit 128M
I've changed the following from 32M to 128M in the following file:
/Applications/MAMP/conf/php5.4.10 memory_limit = 128M
;
I then quit MAMP entirely and restarted it, but in MAMP phpInfo it still reads:
memory_limit 32M
Virtual Hosts
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':
/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
<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)
php.ini
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
Fortunately, configuring MAMP to increase its upload size is simple. All you have to do is update three directives within your local php. ini file: memory_limit , post_max_size , and upload_max_filesize .
Using the memory_limit directive By default, a PHP script can allocate up to 128 megabytes of memory. To verify the current value of the memory_limit directive and other directives, you can use the phpinfo() function.
Edit your wp-config.Open the wp-config. php file and search for this text string: define('WP_MEMORY_LIMIT', '32M'); Then, modify it to read define('WP_MEMORY_LIMIT', '128M'); You can go as high as 256MB, but in most cases, you won't need this much memory.
Managed to solve it ;-)
The correct one is:
/Applications/MAMP/bin/php/php[your_php_version]/conf/php.ini
find 'memory_limit' and increase the number:
memory_limit = [number]M
Thanks!
Make an 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 memory_limit
.
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
memory_limit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With