0

如何配置nginx php7(windows)

 2 years ago
source link: https://forrestsu.github.io/posts/web/%E5%A6%82%E4%BD%95%E9%85%8D%E7%BD%AEnginx-php7windows/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

如何配置nginx php7(windows)

2017年2月1日
| 字数 1140
| Web
| 阅读 39

本文主要介绍如何用Nginx(engine x) 搭建php7的服务器。

1 StartUp

2 Install

1 安装vc14 2 解压nginx到D:\Portable\nginx-1.10.3 3 解压Php到D:\Portable\php-7.1.1x64

3 修改配置文件

3.1 nginx 配置文件

1 修改nginx.conf配置:

2 复制并注释掉fastcgi_param,修改/scripts$document_root

3.2 php配置文件

1 复制php.ini-development到php.ini 启用以下dll: php_bz2.dll、php_curl.dll、php_gd2.dll、php_mbstring.dll、php_openssl.dll、php_pdo_mysql.dll、php_pdo_pgsql.dll

2 修改extension_dir 配置的路径:

extension_dir = “D:/Portable/php-7.1.1x64/ext”

4 创建Bat启动脚本

start_nginx.bat

@echo off
set PHP_FCGI_MAX_REQUESTS=1000
 
echo Starting PHP FastCGI...
RunHiddenConsole D:/Portable/php-7.1.1x64/php-cgi.exe -b 127.0.0.1:9000 -c D:/Portable/php-7.1.1x64/php.ini

echo Starting nginx...
set NGINX_HOME=D:\Portable\nginx-1.10.3
start /D %NGINX_HOME%\ %NGINX_HOME%\nginx.exe

stop_nginx.bat

@echo off
echo Stopping nginx...  
taskkill /F /IM nginx.exe > nul
echo Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe > nul
::exit

5 测试脚本

<?php
    echo "hello world";  
    echo phpinfo();  
?>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK