简体   繁体   English

wamp + wordpress:无法打开流:权限被拒绝

[英]wamp + wordpress: failed to open stream: Permission denied in

I have WAMP and WordPress installed. 我已经安装了WAMP和WordPress。 I am trying to install a new theme. 我正在尝试安装新主题。 After copying it to the themes folder, when entering the themes admin panel to activate the theme I get the error: 将其复制到主题文件夹后,进入主题管理面板以激活主题时,出现错误:

Warning: fopen(C:\\wamp\\www/wp-content/themes/enfold/style.css): failed to open stream: Permission denied in C:\\wamp\\www\\wp-includes\\functions.php on line 3666 警告:fopen(C:\\ wamp \\ www / wp-content / themes / enfold / style.css):无法打开流:在3666行的C:\\ wamp \\ www \\ wp-includes \\ functions.php中,权限被拒绝

It looks like that: 看起来像这样: 在此处输入图片说明

And below that the page continues to render. 并在该页面下方继续呈现。
Have no clue why this is happening. 不知道为什么会这样。

Check your file/folder permissions for wp-content and the theme you uploaded. 检查您的文件/文件夹权限以获取wp内容和上载的主题。

See Changing File Permissions « WordPress Codex 请参阅更改文件权限«WordPress Codex

Typically, all files should be owned by your user (ftp) account on your web server, and should be writable by that account. 通常,所有文件应归您的Web服务器上的用户(ftp)帐户所有,并且应可由该帐户写入。 On shared hosts, files should never be owned by the webserver process itself (sometimes this is www, or apache, or nobody user). 在共享主机上,文件绝对不应由Web服务器进程本身拥有(有时是www,apache或无人使用)。

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). 需要从WordPress进行写访问的任何文件都应由WordPress使用的用户帐户(可能与服务器帐户不同)拥有或拥有。 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 usergroup, such as dhapache or nobody. 例如,您可能具有一个用户帐户,该帐户使您可以将FTP文件来回传送到服务器,但是服务器本身可以使用单独的用户(在dhapache或none)中的单独用户组中运行。 If WordPress is running as the FTP account, that account needs to have write access, ie, be the owner of the files, or belong to a group that has write access. 如果WordPress以FTP帐户的身份运行,则该帐户需要具有写访问权限,即是文件的所有者,或者属于具有写访问权限的组。 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). 在后一种情况下,这意味着权限设置得比默认设置更大(例如,文件夹设置为775,而不是755,而664而不是644)。

To get WordPress and WAMP to automatically set permissions for a new theme, use the Admin area of WordPress to upload and install the theme. 要使WordPress和WAMP自动为新主题设置权限,请使用WordPress的“管理”区域上载并安装主题。 See Appearance>>Themes>>Use the Add New button. 请参阅外观>>主题>>使用添加新按钮。

In my case the theme folder (and the files in it) was read only and it was also encrypted. 在我的情况下,主题文件夹(及其中的文件)是只读的,并且也已加密。

Right click on the folder-->Properties , make sure Read-only is not selected, then click Advanced button, make sure "Encrypt contents to secure data" in not selected, hit OK and then OK again, "Apply changes to this folder, subfolders and files". 右键单击文件夹->“属性”,确保未选中“只读”,然后单击“高级”按钮,确保未选中“加密内容以保护数据”,单击“确定”,然后再次单击“将更改应用于此文件夹” ,子文件夹和文件”。 That should do it:) 那应该做的:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM