首頁>Web>source

我遇到了一个非常令人沮丧的問题,我似乎無法以帖子內容或通過瀏覽器上傳器,多檔案上傳器將任何圖像上傳到wordpress。

將單个圖像直接上傳到Gutenberg時,我得到了載入動画的時間,然後出現"响應不是有效的JSON响應"錯誤. AJAX响應是錯誤500。尝試通過wordpress媒體標簽中的瀏覽器上傳器上傳圖像時,也会發生同樣的事情。

500响應時,服務器日志如下:

2020-02-12 12:42:27.626436 [INFO] [-Q:CB9E669F502E857E-215#wordpress] [REWRITE] detect external loop redirection with target URL: https://domain.com/wp-admin/admin-ajax.php, skip.
2020-02-12 12:42:38.421757 [INFO] [-Q:CB9E669F502E857E-163#wordpress:lsapi] Connection idle time too long: 301 while in state: 6 watching for event: 8452, close!
2020-02-12 12:42:38.422072 [INFO] [-Q:CB9E669F502E857E-163] Content len: 288523, Request line: 
POST /wp-json/wp/v2/media?_locale=user HTTP/1.1
2020-02-12 12:42:38.422211 [INFO] [-Q:CB9E669F502E857E-163] Redirect: #1, URL: /index.php

這个問题似乎在最近才出現,因為我以前上傳的圖像没有任何問题.我的wordpress安裝使用的是自定義主题和几个插件,但是恢複為預設主题並禁用所有插件似乎無法解決問题.我還尝試將wordpress安裝本身還原為较早的版本,這再次對解決该問题無效。

這使我相信問题必须出在服務器上,但是我也不確定那可能是什麼問题。

该服務器是Digital Ocean OpenLiteSpeed wordPress"預設"(https:// marketplace .digitalocean.com / apps / openlitespeed-wordpress)在2GB的小滴上執行。

我已经安裝了wordpress網站執行狀况插件,有關我的特定安裝和設置的資料如下:

### wp-core ###
version: 5.3.2  
site_language: en_GB  
user_language: en_GB  
https_status: true  
user_registration: 0  
default_comment_status: open  
multisite: false  
user_count: 1  
dotorg_communication: true  
### wp-paths-sizes ###
wordpress_path: /var/www/html  
wordpress_size: 842.34 MB (883256225 bytes)  
uploads_path: /var/www/html/wp-content/uploads  
uploads_size: 679.64 MB (712654023 bytes)  
themes_path: /var/www/html/wp-content/themes  
themes_size: 2.17 MB (2272815 bytes)  
plugins_path: /var/www/html/wp-content/plugins  
plugins_size: 70.21 MB (73618620 bytes)  
database_size: 11.55 MB (12107776 bytes)  
total_size: 1.57 GB (1683909459 bytes)  
### wp-dropins (1) ###
advanced-cache.php: true
### wp-themes-inactive (1) ###
Twenty Twenty: version: 1.1, author: the WordPress team
### wp-plugins-active (12) ###
Advanced Custom Fields: version: 5.8.7, author: Elliot Condon  
Coming Soon Page, Under Construction & Maintenance Mode by SeedProd: version: 5.1.0, author: SeedProd  
Contact Form 7: version: 5.1.6, author: Takayuki Miyoshi  
Edit Author Slug: version: 1.6.1, author: Brandon Allen  
Error Log Monitor: version: 1.6.9, author: Janis Elsts  
Health Check & Troubleshooting: version: 1.4.2, author: The WordPress.org community  
LiteSpeed Cache: version: 2.9.9.2, author: LiteSpeed Technologies  
Media Cloud: version: 3.3.11, author: interfacelab  
Minify HTML: version: 1.99, author: Tim Eckel  
Smush: version: 3.4.2, author: WPMU DEV  
WP Mail SMTP: version: 1.8.1, author: WPForms  
WP User Avatar: version: 2.2.4, author: flippercode  
### wp-media ###
image_editor: \ILAB\MediaCloud\Tools\Storage\StorageImageEditor  
imagick_module_version: 1687  
imagemagick_version: ImageMagick 6.9.7-4 Q16 x86_64 20170114  
http://www.imagemagick.org  
gd_version: bundled (2.1.0 compatible)  
ghostscript_version: 9.26  
### wp-server ###
server_architecture: Linux 4.15.0-76-generic x86_64  
httpd_software: LiteSpeed  
php_version: 7.3.14-1+bionic 64bit  
php_sapi: litespeed  
max_input_variables: 1000  
time_limit: 90  
memory_limit: 512M  
max_input_time: 60  
upload_max_size: 10M  
php_post_max_size: 10M  
curl_version: 7.58.0 OpenSSL/1.1.1  
suhosin: false  
imagick_availability: true  
server-headers:   
    expires: Wed, 11 Jan 1984 05:00:00 GMT  
    cache-control: no-cache, must-revalidate, max-age=0  
    content-type: text/html; charset=UTF-8  
    link: Array  
    x-litespeed-tag:  
fc6_tag_priv,public:fc6_front,public:fc6_URL.6666cd76f96956469e7be39d750cc7d9,public:fc6_F,public:fc6_Po.11,public:fc6_PGS,public:fc6_  
    x-litespeed-cache: miss  
    content-encoding: gzip  
    vary: Accept-Encoding  
    date: Tue, 11 Feb 2020 13:10:35 GMT  
    server: LiteSpeed  
    alt-svc: quic=":443"; ma=2592000; v="43,46", h3-Q043=":443"; ma=2592000, h3-Q046=":443"; ma=2592000, h3-Q050=":443"; ma=2592000, h3-24=":443"; ma=2592000, h3-25=":443"; ma=2592000  
htaccess_extra_rules: true  
### wp-database ###
extension: mysqli  
server_version: 10.3.22-MariaDB-1:10.3.22+maria~bionic  
client_version: mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $
### wp-constants ###
WP_HOME: undefined  
WP_SITEURL: undefined  
WP_CONTENT_DIR: /var/www/html/wp-content  
WP_PLUGIN_DIR: /var/www/html/wp-content/plugins  
WP_MAX_MEMORY_LIMIT: 512M  
WP_DEBUG: true  
WP_DEBUG_DISPLAY: true  
WP_DEBUG_LOG: false  
SCRIPT_DEBUG: false  
WP_CACHE: true  
CONCATENATE_SCRIPTS: undefined  
COMPRESS_SCRIPTS: undefined  
COMPRESS_CSS: undefined  
WP_LOCAL_DEV: undefined  
### wp-filesystem ###
wordpress: writable  
wp-content: writable  
uploads: writable  
plugins: writable  
themes: writable 
最新回復
  • 2020-2-14
    1 #

    看来我已经設法解決了這个問题。

    問题似乎与.htaccess檔案有關,我將.htaccess檔案重置為預設設置,然後停用並重新啟用了所有插件.這樣做之後,一切似乎都再次正常執行。

    我不確定具體是什麼代碼真正匯致了問题。

  • wordpress:wordpress不允许更新插件或wordpress Core
  • wordpress:多个條件控製器