gpt4 book ai didi

wordpress - 上传文件wordpress

转载 作者:行者123 更新时间:2023-12-03 08:07:37 25 4
gpt4 key购买 nike

我正在尝试使用 Media > Add New 选项在 wordpress 中上传文件,但是当我点击上传时,出现以下错误:

Unable to create directory wp-content/uploads/2012/11. Is its parent directory writable by the server?

我安装了 Wordpress 4.3.1。

谢谢

编辑:我在共享服务器上:host=i686-redhat-linux-gnu 和 Apache。我将 wp-content/uploads 的权限更改为 755 和 777,但出现以下错误:

“my_file.jpg” has failed to upload due to an error Unable to create directory wp-content/uploads/2012/11. Is its parent directory writable by the server?

有什么想法吗?

最佳答案

您需要为/uploads/和可能的/wp-content/设置文件夹权限。

通常,两个文件夹都应为 755。您可能必须暂时将/uploads/提高到 777 并上传图像(这也会强制服务器将文件夹权限和用户更改为正确的设置),但请立即将其改回 755。

使用 FTP 客户端设置权限最简单。参见 FilezillaFTP Clients « WordPress Codex .

并查看 Changing File Permissions « WordPress Codex正确的 Wordpress 权限设置:

From the codex.wordpress: Typically, all files should be owned by your user (ftp) account on your web server, and should be writable by that account. On shared hosts, files should never be owned by the webserver process itself (sometimes this is www, or apache, or nobody user).

Any file that needs write access from WordPress should be owned or group-owned by the user account used by the WordPress (which may be different than the server account). For example, you may have a user account that lets you FTP files back and forth to your server, but your server itself may run using a separate user, in a separate user group, such as dhapache or nobody. If WordPress is running as the FTP account, that account needs to have write access, i.e., be the owner of the files, or belong to a group that has write access. In the latter case, that would mean permissions are set more permissively than default (for example, 775 rather than 755 for folders, and 664 instead of 644).

关于wordpress - 上传文件wordpress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13258432/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com