WordPress 异步-upload.php 403 错误

WordPress async-upload.php 403 error

对于我的一个客户,我已应要求将他们的网页移动到 VPS。但我是一名网络开发人员,不擅长服务器配置。

由于权限配置错误,在我看来,我无法在媒体库中获取图像,没有错误或......此外,当我尝试上传新文件时,它会完成 Uploading 过程,但会卡在 Processing 过程中并在异步时出现 403 错误- upload.php.

我已经在 wp-content 和 [=] 上尝试了 755777 权限26=]wp-content/uploads,没有解决问题。

如有任何帮助,我们将不胜感激。

编辑: 添加日志。

这些来自requests.log

*.252.164.35 - - [20/Nov/2015:18:14:48 -0500] "GET /xml_feed/********.php HTTP/1.1" 200 1861
*.252.164.35 - - [20/Nov/2015:18:14:51 -0500] "GET /xml_feed/*****.php HTTP/1.1" 200 394
*.252.164.35 - - [20/Nov/2015:18:14:52 -0500] "GET /xml_feed/***.php HTTP/1.1" 200 359
*.253.241.91 - - [20/Nov/2015:18:14:50 -0500] "POST /wp-admin/async-upload.php HTTP/1.1" 200 11
*.253.241.91 - - [20/Nov/2015:18:14:53 -0500] "POST /wp-admin/async-upload.php HTTP/1.1" 403 3214

编辑 2: 授予所有文件夹 777 权限,现在我可以重新安装我的 WP 设置并从面板更新我的插件,但媒体库问题仍然存在,async-upload.php 仍然给出 403 错误。

似乎是错误配置的插件导致了这个问题。话题可以关闭了。

当我更改服务器时,我在我的数据库中使用了查找和替换文件夹结构 /folder_name/public_html/blog -> /srv/www/html/blog。这个工具很好用 interconnect。我最初尝试在记事本中查找和替换,但

SELECT * FROM wp_posts WHERE ID = '0' AND post_type = 'attachment';

SELECT ID, COUNT(*) c FROM wp_posts GROUP BY ID HAVING c > 1;

我的问题与数据库上的 auto_increment 问题有关。

以下是为我修复的问题:

DELETE FROM wp_termmeta  WHERE meta_id=0;
DELETE FROM wp_terms  WHERE term_id=0;
DELETE FROM wp_term_taxonomy  WHERE term_taxonomy_id=0;
DELETE FROM wp_commentmeta  WHERE meta_id=0;
DELETE FROM wp_comments  WHERE comment_ID=0;
DELETE FROM wp_links  WHERE link_id=0;
DELETE FROM wp_options  WHERE option_id=0;
DELETE FROM wp_postmeta  WHERE meta_id=0;
DELETE FROM wp_users  WHERE ID=0;
DELETE FROM wp_posts  WHERE ID=0;
DELETE FROM wp_usermeta  WHERE umeta_id=0;

ALTER TABLE  wp_termmeta ADD PRIMARY KEY(meta_id);
ALTER TABLE  wp_terms ADD PRIMARY KEY(term_id);
ALTER TABLE  wp_term_taxonomy ADD PRIMARY KEY(term_taxonomy_id);
ALTER TABLE  wp_commentmeta ADD PRIMARY KEY(meta_id);
ALTER TABLE  wp_comments ADD PRIMARY KEY(comment_ID);
ALTER TABLE  wp_links ADD PRIMARY KEY(link_id);
ALTER TABLE  wp_options ADD PRIMARY KEY(option_id);
ALTER TABLE  wp_postmeta ADD PRIMARY KEY(meta_id);
ALTER TABLE  wp_users ADD PRIMARY KEY(ID);
ALTER TABLE  wp_posts ADD PRIMARY KEY(ID);
ALTER TABLE  wp_usermeta ADD PRIMARY KEY(umeta_id);

ALTER TABLE wp_termmeta CHANGE meta_id meta_id  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_terms CHANGE term_id term_id  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_term_taxonomy CHANGE term_taxonomy_id term_taxonomy_id  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_commentmeta CHANGE meta_id meta_id  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_comments CHANGE comment_ID comment_ID  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_links CHANGE link_id link_id  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_options CHANGE option_id option_id  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_postmeta CHANGE meta_id meta_id  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_users CHANGE ID ID  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_posts CHANGE ID ID  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_usermeta CHANGE umeta_id umeta_id  BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;

取自here