Score:0

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes)

jp flag

I have exported a WordPress XML file which contain all pages, posts, WooCommerce products, orders etc. File size is 100MB. Now I am trying to import it on another machine but getting error. It even shows that allowed file size is 200MB. This is a 1GB RAM, 1 Core VPS.

enter image description here

But I am getting following error:

[error] 3811#3811: *10 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/stackoverflow.com/wp-content/plugins/wordpress-importer/parsers/class-wxr-parser-simplexml.php on line 211; PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/stackoverflow.com/wp-includes/error-protection.php on line 48"

This is despite the fact that that I am using following limits.

wp-config.php

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

/etc/nginx/sites-available/stackoverflow

server
{
    client_max_body_size    200M;
}

/etc/php/8.2/fpm/php.ini

post_max_size           200M
upload_max_filesize     200M

How to fix this issue?

tsc_chazz avatar
vn flag
Considered a higher limit amount in `wp-config.php`? `268435456 bytes` is `256M` pretty much exactly...
jp flag
`post_max_size` & `upload_max_filesize` aren't related to this error, but increasing them may cause more of these errors.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.