文件权限问题

学习如何处理Warp主题中的文件权限问题。


在使用Joomla或Wordpress时,有两种访问文件的方式:直接通过WEB服务器或者FTP客户端。不同的文件和目录拥有不同的权限,指定谁能读取、写入或访问他们。有时,web服务器和FTP客户端的权限设置可能冲突,所以,在后短尝试安装扩展时,你会遇到这些消息,例如JFolder::create: Could not create directoryDirectory not writable: /administrator/templates/system/ 或者您可能无法保存主题设置。

改变文件权限

要想解决这些问题,你需要改变受影响的文件或目录的权限。

使用FTP 客户端

  1. 打开你的FTP客户端,没有的话下载安装FileZilla 吧。
  2. 使用FTP客户端登入服务器,进入相应的web根目录。
  3. 鼠标右击想要改变权限的目录,点击文件权限/File Permissions...
  4. 其中改变文件属性/Change File Attributes对话框让你能查看各种选项或755这样的数值。确保递归到子目录/Recurse into subdirectories选项已被选中。然后点击OK。

重要 避免出现 777 权限。如果web服务器在 755 权限下依然有问题,可以尝试 775 ,最后才尝试使用 777

使用Joomla扩展访问web服务器

Using an FTP client may also change file ownership to the FTP user of the files or directories you changed the permissions on. This may cause problems on some webservers. To avoid this, you can use a Joomla component like eXtplorer to update the permission through the Joomla administration.

  1. Download the Joomla component eXtplorer and install it. It allows you to edit, delete, copy, rename, archive and unpack files and directories directly on your webserver.
  2. Login to your Joomla administration, go to the eXtplorer component and browse to the directory on which you want to change the permissions.
  3. Right click on the directory and choose Change Rights.
  4. Check the options as shown below. Make sure the Recurse into subdirectories option is checked. Then hit the Save button.

Find out more about file permissions in the Joomla documentation.

WordPress

查看WordPress 文档,了解关于文件权限的更多信息。