WSL2&Ubuntu安装PHP开发环境

KarlXu【原创】 2020-12-17 10:59:13

## WSL2&Ubuntu 安装 PHP 开发环境 - 更新并升级 ``` sudo apt update sudo apt upgrade ``` - 安装 nginx ``` sudo apt install nginx ``` 验证 nginx 配置 `nginx -t` 报错: ``` nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) 2020/12/16 16:47:58 [warn] 19050#19050: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok 2020/12/16 16:47:58 [emerg] 19050#19050: open() "/run/nginx.pid" failed (13: Permission denied) nginx: configuration file /etc/nginx/nginx.conf test failed ``` 原因是当前用户权限不足 `su root` 切换到 root 即可 `service nginx start` 启动服务

标签:
windows wsl2 ubuntu
原创
2631 浏览