Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 45 bytes)

IF your wordpress blog has thoudsands of post, and we add the follow code to show all your wordpress posts:

$rand_posts = get_posts(‘numberposts=-1&orderby=title&order=ASC’);

If you try to show all posts at one page, you will have problems, and showing the following error code:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 45 bytes) in D:\xampp\htdocs\wp\medical\wp-includes\functions.php on line 2913

 Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 128 bytes) in D:\xampp\htdocs\wp\medical\wp-includes\functions.php on line 2913

or something like this, how to resolve the problem then?

Two steps:

1. modify wp-config.php, add one line:
define(‘WP_MEMORY_LIMIT’, ‘64M’);
you can increase 64M to more big number also, say 1024M

2. Modify php.int

memory_limit = 64MB

you can increase 64M to more big number also, say 1024M