win11搭建nginx+php环境

win11搭建nginx+php环境

nginx 配置

nginx-1.24.0/nginx.conf

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root   html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

特别注意: $document_root$fastcgi_script_name; 其中1个字符都不能错,这里是与默认的配置信息不同的。

在 html 目录下放入

index.php

<?php

phpinfo();

?>

php 的配置

D:\tools\php-7.4.33-nts-Win32-vc15-x64\php.ini

cgi.fix_pathinfo=1

extension_dir = "ext"

根据需要开放扩展库

extension=bz2
extension=gd2
extension=mbstring
extension=pdo_mysql
extension=pdo_sqlite

启动

cd /d D:\tools\nginx-1.24.0
nginx


cd /d D:\tools\php-7.4.33-nts-Win32-vc15-x64
php-cgi.exe -b 127.0.0.1:9000 -c php.ini

http://localhost/index.php

img

参考资料

windows10搭建nginx1.19.3+php7.4
https://blog.csdn.net/u014650004/article/details/109240528

posted @   lvye1221  阅读(311)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤
点击右上角即可分享
微信分享提示