您好,我有一个经销商帐户,在共享主机上有一个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
更新:这是我的功能。我的主题的php
http://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错误”是很奇怪的,你知道为什么会发生这种情况吗?我怎样才能修复它?