Realmente es el servicio Apache el que asigna la memoria al módulo PHP, pero por mucha memoria que asignemos debe ser el propio wordpress el que la controle.
Existen multitud de trucos y varios, pero lo que realmente es efectivo sería modificar los valores en el archivo:
- wp-includes/default-constants.php
Una vez abierto en un editor el archivo, veremos algo similar a:
function wp_initial_constants() { global $blog_id; // set memory limits if ( !defined('WP_MEMORY_LIMIT') ) { if ( is_multisite() ) { define('WP_MEMORY_LIMIT', '64M'); } else { define('WP_MEMORY_LIMIT', '40M'); } } if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) { define( 'WP_MAX_MEMORY_LIMIT', '256M' ); } if ( ! isset($blog_id) ) $blog_id = 1; // set memory limits. if ( function_exists( 'memory_get_usage' ) ) { $current_limit = @ini_get( 'memory_limit' ); $current_limit_int = intval( $current_limit ); if ( false !== strpos( $current_limit, 'G' ) ) $current_limit_int *= 1024; $wp_limit_int = intval( WP_MEMORY_LIMIT ); if ( false !== strpos( WP_MEMORY_LIMIT, 'G' ) ) $wp_limit_int *= 1024; if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || $current_limit_int < $wp_limit_int ) ) @ini_set( 'memory_limit', WP_MEMORY_LIMIT ); }
Tan solo tenemos que modificar la línea define(‘WP_MEMORY_LIMIT’, ’40M’); y ponemos 64M que es más que suficiente y ya lo tenemos. Guardamos y listo.