Hello I have a reseller account with one wp 3.5 multisite on a shared hosting.

Suddenly I can't upload photos after some random dimensions(It uploads the small sized ones just fine, but it has problems with the bigger ones).Specific any photo over than 511(width) i got http error , and any image less than 511(width) upload without any http error

Operating System : Linux (64 Bit)

Server: LiteSpeed

Apache version: 2.2.23

Entry Processes: 20

Virtual Memory Usage & Physical Memory Usage: 1048576 KB (each)

I/O Usage: 1024 KB/s

My PHP specs:

  • PHP Version: 5.3.18
  • mysql Client API version: 5.1.65-cll
  • post_max_size 60m (Local Value) - 60m (Master Value)
  • upload_max_filesize 100m (Local Value) - 200m (Master Value)
  • memory_limit 1024m (Local Value) - 1024m (Master Value)
  • max_input_time 60 (Local Value) - 60 (Master Value)
  • max_execution_time 3600 (Local Value) - 600 (Master Value)

functions.php of my theme: http://pastebin.com/ddEQqVJy

My multisite .htaccess is

   <IfModule mod_security.c>
   <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    #<IfModule mod_security.c>
    #SecFilterEngine Off
    #SecFilterScanPOST Off
    php_value memory_limit 1024M
    php_value max_execution_time 3600
    php_value post_max_size 60M
    php_value upload_max_filesize 100M
    #php_value memory_limit 128M
    #php_admin_flag safe_mode off
    # Prevent folder browsing
    Options All -Indexes

    <Files wp-config.php>
    order allow,deny
    deny from all

    # BEGIN feedburner and uploaded files adjustments.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]
    RewriteRule ^feed/?.*$ http://feeds.feedburner.com/mysite [L,NC,R=302]
    RewriteRule ^home?.*$ http://feeds.feedburner.com/mysite [L,NC,R=301]
    RewriteRule ^wp-content/uploads/(.*)$ http://mysite.com/files/$1 [L,R=301]
    RewriteRule ^wp-content/gallery/(.*)$ http://mysite.com/files/$1 [L,R=301]
    RewriteRule ^wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf$ http://mysite.com/files/jw-player-plugin-for-wordpress/player/player.swf$1 [L,R=301]

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .wp-signup.php*
    RewriteCond %{HTTP_REFERER} !.mysite.com. [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule (.*) http://die-spammers.com/ [R=301,L]

    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} .wp-comments-post.php*
    RewriteCond %{HTTP_REFERER} !.*mysite.com.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

    # BEGIN Watermark Hotlinked Images
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?mysite.com  [NC]
    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?google.\ [NC]
    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?facebook.com [NC]
    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?twitter.com [NC]
    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?yahoo.\ [NC]
    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?bing.\ [NC]
    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?ixquick.com  [NC]
    RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?feeds.feedburner.com/mysite  [NC]
    RewriteRule ^(.*\.(png|gif|jpe?g))$ http://mysite.com/wp-content/plugins/watermark-hotlinked-images/watermark.php?img=$1 [L]

    # END Watermark Hotlinked Images

    #Begin gzip and deflate
    <IfModule mod_deflate.c>
     AddOutputFilterByType DEFLATE text/html text/css application/x-javascript text/plain text/xml image/x-icon
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html M3600
    ExpiresByType text/css M3600
    ExpiresByType application/x-javascript M3600
    ExpiresByType image/bmp M3600
    ExpiresByType image/gif M3600
    ExpiresByType image/x-icon M3600
    ExpiresByType image/jpeg M3600

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    #END WordPress

Update: This is my functions.php of my theme http://pastebin.com/ddEQqVJy

We find the problem , the problem is on

line 131

add_image_size('theme-thumb', 520, 497, true);

lines 267-275

if (function_exists('add_theme_support')) {
    set_post_thumbnail_size(150, 250); // default Post Thumbnail dimensions

if (function_exists('add_image_size')) {
    add_image_size('post-thumb', 310, 9999); //300 pixels wide (and unlimited height)
    add_image_size('widget-thumb', 220, 180, true); //(cropped)

When we took them off it didn't show any "HTTP error" when we uploaded a photo on media.

on function.php of Twenty Twelve use

// This theme uses a custom image size for featured images, displayed on "standard" posts.
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop

without giving any "HTTP error" is strange, do you know why is this happening? And how can I fix it?

  • 1
    What's the HTTP error? Do you have any custom image sizes defined (in your theme or through any plugins)? Do you have any image-related plugins enabled? What happens if you upload other non-image files, e.g. a PDF, that's larger in file size than an afflicting image? Commented Dec 21, 2012 at 19:46
  • @MatthewBoynes Yes, I have custom image sizes and plugins(Smush it). I tried by dissabling all the plugins and I have also tried and another theme and still nothing. With .exe,.zip,.doc files I got this msg “xxx.zip” has failed to upload due to an error Sorry, this file type is not permitted for security reasons. with .pdf uploaded right, with .mp3 freeze at "Crunching…" But I uploaded it.... I returned back to the version 3.4.2 and everything works fine, so the problem occurs with the new version.
    – Alex
    Commented Dec 21, 2012 at 22:07

1 Answer 1


Using LiteSpeed with php 5.3 + Wordpress 3.5 will require to increase External App >> lsphp5 to these values :

Memory Soft Limit = 777M

Memory Hard Limit = 800M

Amazing values for memory setting, but it works for me.

  • ok i sent it to my host this suggestion :), thnx
    – Alex
    Commented Jan 10, 2013 at 5:43
  • can do this, it is a shared server, he are not allowed to change the default values. :/
    – Alex
    Commented Jan 12, 2013 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.