Home  >  Article  >  php教程  >  Debian7用PHP5-FPM支持Nginx和PHP交互

Debian7用PHP5-FPM支持Nginx和PHP交互

WBOY
WBOYOriginal
2016-06-06 20:09:26960browse

上上篇文章讲述了Debian7中安装Nginx+Mysql+PHP的方法,当时参考的文章有点过时,所以选择了PHP-CGI的方式进行Nginx和PHP的交互,后经网友提点后发现,原来新版的PHP已经内置了PHP交互工具PHP5-FPM,于是抽时间改了回来。 方法很简单,把Nginx配置修改成如下

上上篇文章讲述了Debian7中安装Nginx+Mysql+PHP的方法,当时参考的文章有点过时,所以选择了PHP-CGI的方式进行Nginx和PHP的交互,后经网友提点后发现,原来新版的PHP已经内置了PHP交互工具PHP5-FPM,于是抽时间改了回来。

方法很简单,把Nginx配置修改成如下的样子就可以了。

location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn