Importing Blogger to Wordpress - memory size error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Importing Blogger to Wordpress - memory size error

Post by simonmlewis »

[text]Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 45 bytes) in C:\xampp\phpMyAdmin\website\wp-includes\SimplePie\Parser.php on line 323[/text]

Hi.
I've been asked to move a Blogger site to Wordpress. Easy, or so it seems. But when I use the Blogger Install plugin, and install a 24mb file, I get this error.

My memory php.ini is set to 128mb. So what on earth is causing this? Sometimes it says tried to allocate 28bytes.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Importing Blogger to Wordpress - memory size error

Post by Celauran »

268435456 bytes = 256 MB
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Importing Blogger to Wordpress - memory size error

Post by simonmlewis »

The XML file is only 23.3mb though................ ?!?!?!
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Importing Blogger to Wordpress - memory size error

Post by Celauran »

What's more important is what is being done with it. That's where the memory is being eaten up.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Importing Blogger to Wordpress - memory size error

Post by simonmlewis »

Sure, but this is a fresh install. No other plugins. No Posts. No Pages. Not even a menu.
I literally installed Wordpress. Then installed the Blogger Install plugin, and trying to import this 23mb file.
Could it just be a really dodgy install somehow??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Importing Blogger to Wordpress - memory size error

Post by Celauran »

simonmlewis wrote:Could it just be a really dodgy install somehow??
More likely that the plugin is super inefficient. You may need to do it in chunks. Or, especially if it's a one off, just throw more RAM at it and get it done.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Importing Blogger to Wordpress - memory size error

Post by simonmlewis »

It would be a one-off yes. I did change php.ini's memory size line to 300MB, but that didn't work. Any other areas to alter in php.ini or wp-config??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Importing Blogger to Wordpress - memory size error

Post by Celauran »

simonmlewis wrote:but that didn't work
Bit vague, no? Did you restart the web server after having made that change? What about something like

Code: Select all

ini_set('memory_limit', '512M');
Kinda gross, but if it's just once...
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Importing Blogger to Wordpress - memory size error

Post by simonmlewis »

I have tried php.ini setting the memory_limit to 512m.
memory_limit=512M

I've also tried changing the wp-config with your code.
Both restarting apache after. But get the same result.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Importing Blogger to Wordpress - memory size error

Post by Celauran »

simonmlewis wrote:But get the same result.
The same as what?
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Importing Blogger to Wordpress - memory size error

Post by simonmlewis »

Sorry? As in, each time the result is identical.
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 45 bytes) in C:\xampp\phpMyAdmin\website\wp-includes\SimplePie\Parser.php on line 323

If I do it in php.ini or in wp-config.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Importing Blogger to Wordpress - memory size error

Post by Celauran »

So the memory limit isn't changing, then. Have you tried it using ini_set? This is local?
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Importing Blogger to Wordpress - memory size error

Post by simonmlewis »

This is indeed local.
How do I use it "ini_set"?
The code you supplied I put in wp-config.php, so I Assume that's not right.

I did just add that at the top of php.ini, but it caused an sql issue. Maybe it replaces the other one??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Importing Blogger to Wordpress - memory size error

Post by simonmlewis »

Hold fire.
https://wordpress.org/plugins/wp-all-import/
Giving this a go instead.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Importing Blogger to Wordpress - memory size error

Post by Celauran »

It's possible ini_set is being overwritten elsewhere in the code. php.ini would be your best bet, though I can't say why it's not working. Barring that, try calling it right before the import is called. If that still doesn't work, you may want to try breaking the XML file into smaller chunks.
Post Reply