Image uploads erroring out with media upload into the media library

We have a number of installs, and we have noticed in the past couple of upgrades to wordpress that image uploads are failing over and over. This is on multisites and single wp installations. While we can certainly ftp, our clients using the blogs don't always know how to do an image that way.

Here is what the error looks like:

Most common we get: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /home/username/public_html/wp-admin/includes/template.php on line 1826

Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ Server at (mydomain).com Port 80

We use dedicated servers and vps. In all cases we are using WHM/cpanel and have full access. We have checked the ini files, etc. We have adjusted to the max. All to no avail.

I saw one post somewhere else talking about the .htaccess file.

Of course I have a .htaccess file for each installation, and they typically look like this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

FTP is not an issue. It is just the HTTP uploads in wordpress.

Anyone know a solution?



  • Timothy Bowers

    The error is telling you that your memory has been exhausted for php. This will happen more when processing larger uploads.

    Your error is 33554432 bytes, thats 32MB which is a little low for WordPress especially if you have plugins running there as well.

    If you increase that then you should be fine. Some of mine are running at 256mb.

    Anyway, there are a number of ways to do this, if your setup can be modified with php then you can add this to your wp-config.php file:

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

    Or in htaccess:

    php_value memory_limit 64M

    Or php.ini:

    memory_limit = 64M

    Replace the number to a value which you need. If you get stuck or you find those memory increases are not set then you can consult with your host to get that sorted.

    Take care.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.