如何使用nginx安装php
我对所有与Web服务器相关的事情都是新手。直到现在,我都使用apache。但我想尝试一下nginx。所以我决定把它和PHP一起安装。以下是我遵循的步骤(我提到我使用Windows 7):如何使用nginx安装php,php,nginx,Php,Nginx,我对所有与Web服务器相关的事情都是新手。直到现在,我都使用apache。但我想尝试一下nginx。所以我决定把它和PHP一起安装。以下是我遵循的步骤(我提到我使用Windows 7): 从官方网站下载nginx 从官方网站下载php5.6.11 我在C:/drive中提取了nginx 我将php提取并复制到nginx中 我创建了start.bat文件(在nginx文件夹中),代码如下: @回音 启动C:\nginx\nginx.exe 启动C:\nginx\php\php-cgi.exe-B1
------------------------------------------------------
An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.
If you are the system administrator of this resource then you should check the error log for details.
Faithfully yours, nginx.
-----------------------------------------------------
如果我按照错误日志
链接操作,我会看到以下屏幕:
有解决办法吗?谢谢。下载两个设置后,将它们解压缩到C://驱动器中 将extract php文件夹放在nginx文件夹中 现在按照我在本视频中所做的步骤进行操作 要在nginx中配置PHP,我们需要在nginx.conf文件中进行一些更改 删除nginx.conf文件中的旧代码粘贴到nginx.conf中的代码下面 以下是代码:
location ~ .php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME C:/nginx/html/$fastcgi_script_name;
}
要启动nginx和php,请使用以下批处理代码:
@ECHO OFF
start C:\nginx\nginx.exe
start C:\nginx\php\php-cgi.exe -b 127.0.0.1:9000 -c C:\nginx\php\php.ini
ping 127.0.0.1 -n 1>NUL
echo Starting nginx
echo .
echo ..
echo ...
ping 127.0.0.1 >NUL
EXIT
要停止nginx和php,请使用下面的批处理代码
@ECHO OFF
taskkill /f /IM nginx.exe
taskkill /f /IM php-cgi.exe
Exit
下载两个设置后,将它们解压缩到C://驱动器中 将extract php文件夹放在nginx文件夹中 现在按照我在本视频中所做的步骤进行操作 要在nginx中配置PHP,我们需要在nginx.conf文件中进行一些更改 删除nginx.conf文件中的旧代码粘贴到nginx.conf中的代码下面 以下是代码:
location ~ .php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME C:/nginx/html/$fastcgi_script_name;
}
要启动nginx和php,请使用以下批处理代码:
@ECHO OFF
start C:\nginx\nginx.exe
start C:\nginx\php\php-cgi.exe -b 127.0.0.1:9000 -c C:\nginx\php\php.ini
ping 127.0.0.1 -n 1>NUL
echo Starting nginx
echo .
echo ..
echo ...
ping 127.0.0.1 >NUL
EXIT
要停止nginx和php,请使用下面的批处理代码
@ECHO OFF
taskkill /f /IM nginx.exe
taskkill /f /IM php-cgi.exe
Exit
这可能更适合这可能更适合