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

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

WBOY
Release: 2016-06-06 20:09:26
Original
1014 people have browsed it

上上篇文章讲述了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;
}
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template