PHP配置:修订间差异
外观
无编辑摘要 |
无编辑摘要 |
||
| 第6行: | 第6行: | ||
接下来输入 <code>apt install nginx php-fpm -y</code> 系统会自动帮我们处理好依赖的 | 接下来输入 <code>apt install nginx php-fpm -y</code> 系统会自动帮我们处理好依赖的 | ||
安装好了,我们打开 "/etc/nginx" 文件夹 | |||
<br> | |||
我个人建议注释掉当前目录下 "sites-enable/default"文件里面的全部内容,这样会比较干净 | |||
然后再建立名为 "service" 的文件 | |||
<br> | |||
往里面写入 | |||
server { | |||
listen: 80; | |||
servername: _; | |||
index index.html index.htm index.nginx-debian.html; | |||
location \ { | |||
} | |||
} | |||
接下来再运行<code>systemctl restart nginx</code> | |||
<br> | |||
如果不保险的话还可以执行两遍<code>nginx</code> | |||
如果有问题的话,会显示出来的 | |||
最后,在你的浏览器输入你的服务器ip | |||
<br> | |||
看到了 | |||
Welcome to nginx! | |||
If you see this page, the nginx web server is successfully installed and | |||
working. Further configuration is required. | |||
<br> | |||
For online documentation and support please refer to nginx.org. | |||
Commercial support is available at nginx.com. | |||
Thank you for using nginx. | |||
恭喜你!!!大功告成!!! | |||
[[Category:php]] | [[Category:php]] | ||
[[Category:记录]] | [[Category:记录]] | ||
2026年8月21日 (五) 05:21的版本
记录从零开始配置PHP环境
目前基于Debian13虚拟机,刚刚安装好的没有图形化界面,执行了命令
apt upgrade -y && apt install vim -y
接下来输入 apt install nginx php-fpm -y 系统会自动帮我们处理好依赖的
安装好了,我们打开 "/etc/nginx" 文件夹
我个人建议注释掉当前目录下 "sites-enable/default"文件里面的全部内容,这样会比较干净
然后再建立名为 "service" 的文件
往里面写入
server {
listen: 80;
servername: _;
index index.html index.htm index.nginx-debian.html;
location \ {
}
}
接下来再运行systemctl restart nginx
如果不保险的话还可以执行两遍nginx
如果有问题的话,会显示出来的
最后,在你的浏览器输入你的服务器ip
看到了
Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx.
恭喜你!!!大功告成!!!