在wordpress中上传图像的内存不足错误

I'm having some problems uploading images in WordPress.

The images them selves are around 1-2mb and width/height is quite big 1000px+ X 1000px+ but the client wants to be able to upload them and let WordPress do the re-sizing.

However when trying to upload I'm getting the following error:

"Fatal error: Out of memory (allocated 28573696) (tried to allocate 4096 bytes)"

Now I understand that this means the server doesn't have enough memory to process the image but when I do a phpinfo() check on the server it tells me that I have 256M of memory.

So why would I be getting a fatal error message saying I'm only allocated 32M?

The website itself is hosted by someone else so I don't have access to a php.ini or any of the error logs.

Thanks In advance,

Mark,

Turned out to be an issue with the company hosting the site limiting the memory allocated. Moved to a new host and the problem was sorted.

phpinfo may be showing you memory for the php config for the whole server rather then the shared account you are using. You may not be able to override with your own php.ini due to the main php config file restricting use of php.ini files.

Try adding the 'define" line below to wp-config.php a few lines of white space below the opening <?php in the file:

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

This may be able to override shared settings to give you more memory.

Even with a very high memory limit, GD will run out of memory processing a full-size photo from a mid-level digital camera. If your server has ImageMagick on the command line, you could use that. When ImageMagick resizes an image it uses a relatively small amount of memory and it is not subject to the PHP memory limit.

I found a WordPress plugin called ImageMagick Engine that claims to make WordPress use ImageMagick instead of GD. I've never used that plugin myself though.