【发布时间】:2021-06-30 09:38:39
【问题描述】:
我正在尝试按照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。
所以我尝试通过重新安装 apache
sudo 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 安装页面。
【问题讨论】: