Roots Discourse

Increasing WP_Memory_Limit


#1

I’ve tried updating the trellis files listed below and adding

define( ‘WP_MEMORY_LIMIT’, ‘512M’ );

To /site/config/environments/development but the limit on my site is still 128M. What am I missing? I’ve reprovisioned the server and ran composer update.

Continuing the discussion from Increase maximum upload size on development env:


Dev on local - vagrant - WP_MEMORY_LIMIT in wp-config.php
#2

Have a look here: Http error media upload


#3

No dice. I reloaded nginx but the php info page still shows the old value for memory limit of 128M

I have this set in users/php/default/main:

php_memory_limit: 512M

Is there somewhere else where this value is set?


#4

Gotta ask this, but did you re-provision the server after updating that value?

Note: you shouldn’t update roles/php/default/main.yml either. You should override that value in a group_vars file (either globally or for a specific environment).


#5

@swalkinshaw How should that be formatted in the group_vars files?


#6

Same as was posted above:

php_memory_limit: 512M

Increasing WP_MAX_MEMORY_LIMIT
#7

@swalkinshaw Oh, it doesn’t need any parent-level indentation or anything? Just drop it into the bottom of the file with no indentation?


#8

Yes, you can follow the examples of lots of vars like that already: https://github.com/roots/trellis/blob/master/group_vars/all/main.yml


#9

Whoops! My bad, I was thinking you were talking about adding these to wordpress_sites.yml. Doh. I appreciate the help sir!


#10

“Re-provision” – sorry, what does it mean ? It’s about this command "ansible-playbook server.yml -e env=production " ?


#11

Yes, see https://roots.io/trellis/docs/remote-server-setup/#provision