我在wordpress上的图片上传时遇到HTTP错误。
要解决此问题,我尝试了以下步骤
我在.htaccess文件中添加了#!/usr/bin/python
import sys
# sys.argv is the list of arguments you pass when you run the program
# but sys.argv[0] is the actual program name
# so you want to start at sys.argv[1]
for arg in sys.argv[1:]:
listVar = arg.split(':')
for i in listVar:
print i
# Optionally print a new line
print
。但问题没有解决。
我还在SetEnv MAGICK_THREAD_LIMIT 1
文件中添加了以下代码。但问题没有解决。
add_filter(' wp_image_editors',' change_graphic_lib');
function change_graphic_lib($ array){
functions.php
}
我还在.httaccess文件中添加了以下代码。
SecFilterEngine Off
SecFilterScanPOST关闭
我还使用了https://github.com/getsource/default-to-gd插件。但我的问题没有解决。
请帮助我如何解决此问题。
答案 0 :(得分:0)
很可能与服务器配置相关的问题是没有为Apache / PHP分配适当的内存量。
如果有人遇到同样的问题,请尝试验证您的服务器配置设置中是否有足够的(64MB +)服务器内存分配给Apache / PHP。您也可以将其添加到您的wp-config.php文件中:define(' WP_MEMORY_LIMIT',' 64MB');
mod_security 可能会导致问题。禁用它以查看是否存在问题。为此,请在wp-admin目录中创建一个.htaccess文件。添加它:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
如果您在Web服务器上使用基于身份验证的访问控制(通常称为htpasswd,基本身份验证,密码保护目录或类似),则WordPress无法为Flash Uploader,Cron和XMLRPC处理它。需要排除相关文件才能工作。请记住,这可能会破坏您的安全考虑。
# Exclude the file upload and WP CRON scripts from authentication
<FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
Satisfy Any
Order allow,deny
Allow from all
Deny from none
</FilesMatch>
最后一点说明:有些人说如果使用较低版本的PHP 5.3.X,你可以尝试禁用PHP安全模式。