Wordpress Fatal error: Allowed memory size exhausted
I'm in the process of importing a huge number of files via .CSV - all that seems to be going fine but after an import finished I started getting this error:
on the WordpPress post management page (http://localhost/wordpress/wp-admin/edit.php
)
( ! ) Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 524288 bytes) in C:\wamp\www\wordpress\wp-includes\class-wp-walker.php on line 176
Call Stack
# Time Memory Function Location
1 0.0016 857424 {main}( ) ..\edit.php:0
2 9.4654 31424712 WP_List_Table->display( ) ..\edit.php:249
3 9.4655 31425264 WP_List_Table->display_tablenav( ) ..\class-wp-list-table.php:709
4 9.4660 31425808 WP_Posts_List_Table->extra_tablenav( ) ..\class-wp-list-table.php:761
5 10.0549 31394480 wp_dropdown_categories( ) ..\class-wp-posts-list-table.php:222
6 16.4317 261790880 walk_category_dropdown_tree( ) ..\category-template.php:370
7 16.4441 266681480 call_user_func_array ( ) ..\category-template.php:763
8 16.4441 266682016 Walker->walk( ) ..\category-template.php:0
9 16.4441 266682064 func_get_args ( ) ..\class-wp-walker.php:176
开发者_如何转开发
and on the import CSV page (http://localhost/wordpress/wp-admin/tools.php?page=csv-importer/csv_importer.php) I get
( ! ) Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 63 bytes) in C:\wamp\www\wordpress\wp-includes\class-wp-walker.php on line 176
Call Stack
# Time Memory Function Location
1 0.0006 707784 {main}( ) ..\tools.php:0
2 0.0014 827336 require_once( 'C:\wamp\www\wordpress\wp-admin\admin.php' ) ..\tools.php:10
3 0.2692 30508160 do_action( ) ..\admin.php:151
4 0.2692 30509656 call_user_func_array ( ) ..\plugin.php:405
5 0.2692 30509688 CSVImporterPlugin->form( ) ..\plugin.php:0
6 0.2694 30510936 wp_dropdown_categories( ) ..\csv_importer.php:111
7 6.3437 260920048 walk_category_dropdown_tree( ) ..\category-template.php:370
8 6.3582 265810672 call_user_func_array ( ) ..\category-template.php:763
9 6.3582 265811208 Walker->walk( ) ..\category-template.php:0
10 6.3582 265811256 func_get_args ( ) ..\class-wp-walker.php:176
I've been searching the last few days trying to figure this out - all fixes seem to point towards moding the php.ini with memory_limit (tried -1 and 9999m) or moding the WP config with define('WP_MEMORY_LIMIT', '64M'); I echo'd out the php info to make sure changes where taking place and it seems they are. I'm running WAMP on windows 64x if that helps.
All posts show up fine on the frontend, it's just in the backend they seem to be producing this error. Honestly I've got no idea what to try next. Any ideas are welcome!
Some webservers may impose memory limits. Check your Apache settings to make sure its not the culprit.
Try these different settings in C:\wamp\bin\apache\apache2.2.6\bin\php.ini
Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M
Change to:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M
And add this to C:\wamp\bin\mysql\mysql5.0.45\my.ini:
max_allowed_packet = 200M
Then restart wamp
Try setting this bit of code at the top of csv_importer.php
:
ini_set('memory_limit', '1024M');
精彩评论