上传特定尺寸的图像时出现HTTP错误

时间:2012-12-21 作者:Alex

您好,我有一个经销商帐户,在共享主机上有一个wp 3.5 multisite。

突然间,我无法上传一些随机尺寸的照片(它可以上传小尺寸的照片,但大尺寸的照片有问题)。具体任何照片超过511(宽度)我得到了http错误,任何图像小于511(宽度)上传没有任何http错误

Operating System : Linux(64位)

Server: LiteSpeed公司

Apache version: 2.2.23

Entry Processes: 20

Virtual Memory Usage & Physical Memory Usage: 1048576 KB(每个)

I/O Usage: 1024 KB/s

My PHP specs:

  • PHP Version: 5.3.18mysql Client API version: 5.1.65-cllpost_max_size 60m(本地值)-60m(主值)upload_max_filesize 100m(本地值)-200m(主值)memory_limit 1024m(本地值)-1024m(主值)max_input_time 60(本地值)-60(主值)max_execution_time 3600(本地值)-600(主值)
functions.php of my theme: http://pastebin.com/ddEQqVJy

我的多站点。htaccess是

    # BASIC SECURITY
   <IfModule mod_security.c>
   <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    #<IfModule mod_security.c>
    #SecFilterEngine Off
    #SecFilterScanPOST Off
    #</IfModule>
    php_value memory_limit 1024M
    php_value max_execution_time 3600
    php_value post_max_size 60M
    php_value upload_max_filesize 100M
    </IfModule>
    #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
    </Files>

    # 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>

    # BEGIN ANTISPAMBLOG REGISTRATION
    <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]
    </IfModule>

    # 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]
    </IfModule>

    # 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>
    <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
    </IfModule>

    # 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
更新:这是我的功能。我的主题的phphttp://pastebin.com/ddEQqVJy

我们发现了问题,问题就出现了

第131行

add_image_size(\'theme-thumb\', 520, 497, true);
第267-275行

if (function_exists(\'add_theme_support\')) {
    add_theme_support(\'post-thumbnails\');
    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)
}
当我们把照片上传到媒体上时,它没有显示任何“HTTP错误”。

on函数。二十个十二的php

// 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
没有给出任何“HTTP错误”是很奇怪的,你知道为什么会发生这种情况吗?我怎样才能修复它?

1 个回复
SO网友:DraCoola

在php 5.3+Wordpress 3.5中使用LiteSpeed需要增加External App >> lsphp5 对于这些值:

内存软限制=777M

内存硬限制=800M

内存设置的惊人价值,但对我来说很有用。

结束

相关推荐

Combining wordpress themes

有没有办法在不使用插件呈现不同主题的页面的情况下组合两个Wordpress主题,如果有,最有效的方法是什么?它是否像复制和粘贴一个主题的功能一样简单。php(和其他文件)进入第一个主题?我是否制作儿童主题?我正试图为全球的清洁能源计划建立一个数据库,并且喜欢我购买的其中一个主题的地图功能。然而,一旦你通过地图,主题就不是很好用,也不能容纳很多信息。这就是第二个主题。如果可能的话,我想保留这两个主题的功能。