- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 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 客户端设置权限最简单。参见 Filezilla和 FTP 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/
我有以下正则表达式 /[a-zA-Z0-9_-]/ 当字符串只包含从 a 到z 大小写、数字、_ 和 -。 我的代码有什么问题? 能否请您向我提供一个简短的解释和有关如何修复它的代码示例? //var
我是一名优秀的程序员,十分优秀!