Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to increase the memory limit on my nginx php-fpm server for wordpress. Specifically the Wordpress plugin WooCommerce needs more available memory.

I've set the following in wp-config.php...

define('WP_MEMORY_LIMIT', '128M');
define('WP_MAX_MEMORY_LIMIT', '128M');

php.ini has the following...

memory_limit = 128M
;suhosin.memory_limit = 0

The fpm server is also set to change this.

php_admin_value[memory_limit] = 128M

Yet WooCommerce's system status still claims it only has 40MB, how can this be?

I believe it might be suhosin but I am unsure how to change this on an OpenBSD server. I've tried changing it in the settings for the php-fpm server pool.

php_admin_value[suhosin.memory_limit] = 128M

If someone can tell me how to change the limit on an OpenBSD server that would be very good.

share|improve this question
    
Did you restart php-fpm? –  Michael Hampton Oct 5 '13 at 15:42
    
Yes I restarted php-fpm. –  John Tate Oct 5 '13 at 21:21
    
Could you post the contents of wp-config.php file, excluding DB credentials, salt, and table_prefix? –  Pothi Oct 6 '13 at 1:24

2 Answers 2

up vote 3 down vote accepted

One can not re-define a constant (in PHP / WordPress). So, you must have put the line...

define('WP_MEMORY_LIMIT', '128M');

at the end of your wp-config.php file. If you are not already aware, the last default line in this file (require_once(ABSPATH . 'wp-settings.php');) setup all the variables and constants.

In order to solve your issue, you must define 'WP_MEMORY_LIMIT' before WordPress sets its constants. So, the contents (or tail wp-config.php) of your site's wp-config.php file should read like this...

define( 'WP_MEMORY_LIMIT', '128M' );

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Basically, there is nothing wrong with Nginx or php-fpm. The issue is in where you define a constant for WordPress.

share|improve this answer

As far as I can remember, Wordpress doesn't list available/maximum RAM but allowed upload file size.

You can change that through the upload_max_filesize and post_max_size settings in php.ini or per-pool in your php-fpm.d/*.conf files.

Concerning nginx, remember to set client_max_body_size 128m; to allow for bigger POST data to be sent to/through the webserver.

share|improve this answer
    
This has nothing to do with upload size. The Wordpress plugin WooCommerce lists available memory on it's system status page. I need to increase the max memory. –  John Tate Oct 5 '13 at 23:27
    
What happens if you go crazy and set memory_limit to 512M or something like that? Make sure there isn't a per-directory php.ini file in effect, overriding the main config. Try momentarily disabling APC as it can show you stale/cached PHP output. –  Andres B Oct 6 '13 at 0:02
    
I don't seem to have APC installed so it isn't that. There is no php.ini for the users directory. –  John Tate Oct 6 '13 at 0:59
    
I definitely don't have APC, just confirmed that. –  John Tate Oct 6 '13 at 1:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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