【问题标题】: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。

我仍然遇到同样的错误。

【问题讨论】:

    标签: wordpress


    【解决方案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');
    

    希望这会有所帮助。 https://wp-me.com/fix-unable-to-create-directory-wp-content-uploads-is-its-parent-directory-writable-by-the-server/

    【讨论】:

    • 如果您的问题将得到解决,那么请将我的答案标记为正确。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2013-05-07
    • 2014-03-14
    • 1970-01-01
    • 2014-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-22
    相关资源
    最近更新 更多