【问题标题】:Error while uploading a file in wordpress “Unable to create directory wp-content/uploads. Is its parent directory writable by the server?”在 wordpress 中上传文件时出错“无法创建目录 wp-content/uploads。服务器可写其父目录吗?”
【发布时间】:2020-06-04 09:58:11
【问题描述】:
我正在使用 wordpress 5.3.2,在上传任何媒体、插件或主题文件时出现错误
“无法创建目录 wp-content/uploads。它的父目录是否可被服务器写入?”
我检查了父文件夹的所有权限,权限是755。
我仍然遇到同样的错误。
【问题讨论】:
【解决方案1】:
一定是文件权限问题,请按以下步骤操作。
1.要授予文件夹的所有权限,请使用 chmod -R 777:
sudo chmod 755 -R /path/to/directory
或 sudo chmod a+rwx /path/to/directory
或 你也可以通过 Filezilla 父目录递归地授予权限。
2.在 wp-config.php 中 在 require_once(ABSPATH . ‘wp-settings.php’); 之前添加代码
define( 'UPLOADS', 'wp-content/uploads' );
define('FS_METHOD', 'direct');
希望这会有所帮助。
原创文章,作者:SONIC SEO,如若转载,请注明出处:https://www.seo388.com/error-while-uploading-a-file-in-wordpress/