0

我正在尝试在 Fedora 27 上使用 VS Code 将 .php 文件保存到 /var/www/html/mysql 但我收到一条消息

在此处输入图像描述

此外,如果我尝试以 root 身份打开 VS Code,我会收到以下消息:

在此处输入图像描述

4

2 回答 2

2

您需要更改对该文件夹的访问权限。有 2 个选项。

  1. sudo chmod 777 /var/www/html/mysql - 更改对 mysql 目录的访问权限
  2. sudo chmod -R 777 /var/www/html/mysql - 更改对 mysql 目录和其中所有子目录的访问权限。
于 2019-05-03T09:21:06.933 回答
0

Even though the accepted answer actually works, I don't recommend to change access rights when using LINUX. Your "web" folder is usually owned by web server's user and group, therefore, it's a good practice to keep the same in your DEV (local) environment (i.e. your PC). It is OK to execute your IDE as sudo if you need to, as long as you handle it locally and keep the same access rights as in QA and PRODUCTION environments.

于 2020-07-02T19:23:21.240 回答