如何解决将 WordPress 文件夹移动到 var/www/html之前/之后的问题
我正在尝试按照 here
上的官方指南在我的虚拟机上安装 WordPress不知何故,我无法将我的 wordpress 文件移动到相应的文件夹 var/www/html。
给出以下错误。
cp: cannot stat ‘~r’: No such file or directory
cp: cannot create regular file ‘/var/www/html/index.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/license.txt’: Permission denied
cp: cannot create regular file ‘/var/www/html/readme.html’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-activate.php’: Permission denied
cp: omitting directory ‘/home/caleb/wordpress/wp-admin’
cp: cannot create regular file ‘/var/www/html/wp-blog-header.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-comments-post.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-config.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-config.php~’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-config-sample.php’: Permission denied
cp: omitting directory ‘/home/caleb/wordpress/wp-content’
cp: cannot create regular file ‘/var/www/html/wp-cron.php’: Permission denied
cp: omitting directory ‘/home/caleb/wordpress/wp-includes’
cp: cannot create regular file ‘/var/www/html/wp-links-opml.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-load.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-login.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-mail.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-settings.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-signup.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/wp-trackback.php’: Permission denied
cp: cannot create regular file ‘/var/www/html/xmlrpc.php’: Permission denied
所以在检查位置之后,我发现我没有 var/www/html 文件夹,因为我之前在 LEMP installation guide 中删除了 apache2。
所以我尝试通过
重新安装apachesudo apt-get install apache2
安装后,我发现var/www/html现在可用。但是我仍然无法在不使用 sudo 的情况下将文件复制到相应的文件夹中,这在指南中没有提到。将文件复制到 var/www/html 目录后,我应该访问我的 IP 地址以继续安装 WordPress。我也失败了,因为浏览器将我定向到 Nginx,就像在 LEMP 指南中一样,而不是在 WordPress 指南中的 WordPress 安装页面。有什么想法吗?
编辑:尝试停止 Nginx 服务但它不起作用。 (不会将我重定向到 WordPress 页面)
TL/DR: WordPress 文件夹不会像指南那样移动到 var/www/html,并且使用 sudo 移动文件夹后,localhost 不会转到 WordPress 安装页面。
解决方法
您应该必须使用 sudo 将任何内容移动到 /var/www/html/。你的导游不提这件事似乎是不负责任的。
使用 mv
而不是 cp
sudo mv /example.com /var/www/html/
您能分享一下您使用的确切 cp 命令吗?看起来您刚刚列出了输出。你在指南中的哪里离开了?
Mods - 我还没有足够的点数来评论,所以为了帮助我不得不在我的回答中提出一个问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。