Articles of php fpm

连接由对等重置

我在我的NGINX error.log上发现了这个错误: 2011/05/09 23:33:52 [error] 22145#0: *1158 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xx.xx.xxx.xxx, server: *.mywebsite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "mywebsite.com" 这是什么意思? 可能是一个PHP的FPM问题?

FastCGI连接在端口9000上被拒绝

我有一个运行PHP 5.3.2 + PHP-FPM和Nginx 0.7.65的站点,并在更改根密码后重新启动服务器。 networking服务器启动正常,但网站没有出现,唯一的线索是在Web应用程序的日志中(特别是Predis): /home/myapp/dev/releases/20110520160839/components/Predis/Predis.php(1250): Predis\TcpConnection->w in /home/myapp/dev/releases/20110520160839/components/Predis/Predis.php on line 1259" while reading response header from upstream, client: 69.XXX, server: dev.example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "dev.example.com" 似乎FastCGI的端口9000拒绝连接。 当我运行“nmap 127.0.0.1”我没有看到任何端口9000。 “netstat -ntlp”确实显示了这一点,虽然: Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:4949 0.0.0.0:* LISTEN 1169/munin-node tcp 0 […]

干净的url问题与ubuntu的Apache,PHP-FPM,FastCGI

那么这是对此的一种转发,但目前还没有人回答我的问题,所以我就在这里。 我正在使用Apache / 2.2.17(Ubuntu)mod_fastcgi与php-fpm,我无法启用干净的URL作为网站返回内部服务器错误。 我认为我的.htaccess设置中有些东西不对。 相同的服务器包含不同的虚拟主机下的Wordpress,它工作正常。 这是我希望可以帮助找出问题的一些相关信息。 我的虚拟主机包含: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot /home/dowsin/public_html FastCgiExternalServer /home/dowsin/public_html/php5.external -host 127.0.0.1:9000 AddHandler php5-fcgi .php Action php5-fcgi /usr/lib/cgi-bin/php5.external Alias /usr/lib/cgi-bin/ /home/dowsin/public_html/ RewriteLog "/home/dowsin/public_html/rewrite.log" RewriteLogLevel 9 <Directory "/home/dowsin/public_html"> allow from all Options -Indexes AllowOverride all </Directory> </VirtualHost> .htaccess包含 RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d […]

php页面在nginx + php-fpm服务器不加载

我已经在CentOS 6系统(在Amazon EC2中托pipe)中安装了nginx服务器和php-fpm,并遵循以下说明: http://emka.web.id/linux/centos-linux/2011/installing-nginx-with-php-and-php-fpm/ 一个静态的html(index.html)加载时,我去我的公共DNS提供的亚马逊,所以nginx的作品,但是当我尝试加载一个PHP页面在“index.php或hello.php”相同的目录中一个错误页面显示以下消息:“您正在查找的页面暂时不可用,请稍后再试。” 当我运行php-fpm没有参数,并再次尝试加载一个php页面,不发送给我的网页,而是显示一条短信:“没有input文件指定”。 / usr / share / nginx / html文件的默认目录 我认为我的configuration有问题,但是我不知道是在php还是在nginx的conf文件中。 /etc/nginx/nginx.conf中有几行我认为是最相关的: # # The default server # server { listen 80; server_name _; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } # redirect server […]

如何让php-fpm在空闲一段时间后将其杀死?

我有几个低stream量的虚拟主机应用程序,我想运行在同一个盒子,使用类似这样的configuration: [example.com] listen = /tmp/example.com.socket listen.owner = www-data listen.group = www-data listen.mode = 0666 user = www-data group = www-data pm = dynamic ; scale children according to this rule pm.max_requests = 1000 ; respawn child after so many requests pm.max_children = 12 ; cap the total number of children thus pm.start_servers = 6 ; […]

FPM活动进程不断增长

最近,我不得不面对php-fpm问题,不断增加可用的活动进程。 它正在达到max_children,然后重新启动。 该图显示了来自三台服务器的池状态(循环余额)中的“活动进程”值。 configuration: pm.max_children = 100 pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 2000 在凌晨1点,我将configuration更改为: pm.max_children = 500 pm.max_requests = 500 这个池服务约4k的需求/分钟(所有的服务器)。 我必须承认其他游泳池正常工作,相同的设置(最大的池服务〜12k的需求/分钟)。 什么可能是这样的行为的理由?

提示将nginx设置为php和node框架的代理

我们有一个当前的,即将成为传统的PHP应用程序安装在生产中,与Apache服务。 工作正常。 目前正在尝试添加新的Node.js alpha堆栈,我们计划在一段时间内安装一个活动框架(在临时服务器上,而不是现在的产品)来安装。 我们将在新环境中使用nginx作为前端节点和其他一些服务。 此外,现在需要继续使用旧的PHP应用程序 – 通过nginx(而不是Apache)。 我的问题: 任何真实世界的生产技巧,将nginx设置为这样的服务的高效反向代理? 这对我来说似乎是非常简单的,而且似乎完全按照预期工作 – 但我一直是一个apache人,所以我只想确保我不会忽略任何安全明智的,performance明智的等等。 从apache支持的PHP切换到php-fpm,以便为现有应用程序提供服务时,应该注意什么? 我从来没有用过这种味道的PHP,但它看起来像通过nginx做到这一点的最佳方式。 所有明显的ini值都移植过了,但我仍然觉得我可能会错过一些东西。

nginx服务.php作为静态文件

好吧,再次显然是一个完全荒谬的问题,我似乎无法弄清楚。 nginx保持服务我的.php文件作为静态文件。 我已经通过ubuntu上的仓库安装了nginx。 我已经安装了php5-fpm(没有configuration改变),都已经重新启动。 我所拥有的设置是尽可能与我的笔记本电脑上的设置相同,并在那里运行。 我甚至设置了像笔记本电脑一样的文件权限,但仍然无济于事。 所以这里是我的网站可用/默认文件 server { #listen 80 default; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 root /home/johnny/*****; #replaced for privacy's sake index index.html index.htm; expires 0; # Make site accessible from http://localhost/ server_name localhost; location / { # First attempt […]

限制PHP-FPM只为特定目录下的文件提供服务

我遇到了PHP-FPM和Apache 2.4.1 mod_proxy_fcgi的问题。 由于mod_proxy_fcgi无法处理Unix套接字,PHP-FPM必须在本地主机上侦听。 因此,任何有权访问服务器的人都可以向PHP-FPM发送请求。 我无法将PHP-FPM限制到我的文档根目录,所以有人可以创build一个恶意的PHP文件,确保我的PHP进程可以访问它,并发送一个特殊的请求到PHP-FPM侦听的端口。 (我已经尝试了,它的工作。) 我在我的apacheconfiguration中有以下内容: <VirtualHost *:80> ServerName example.org DocumentRoot /srv/vhosts/example.org/vhostdata/public/ <Directory /srv/vhosts/example.org/vhostdata/public/> Require all granted </Directory> <LocationMatch ^(.*\.php)$> ProxyPass fcgi://127.0.0.1:6001/srv/vhosts/example.org/vhostdata/public/ ProxyErrorOverride On </LocationMatch> </VirtualHost> 如何让PHP-FPM在收到的每个请求中都占用文档根目录/srv/vhosts/example.org/vhostdata/public/ ? 我已经玩了chdir指令,但它不适合我的需要。 不幸的是,使用chroot不是我的select,因为我正在linux-vserver环境中运行,其中出于安全原因, mknod已被pipe理员禁用。

Ubuntu上的Nginx + PHP-FPM在上传Joomla扩展zip文件时给出“上游发送无效状态”

我有一个在ESV虚拟机环境中运行的Ubuntu服务器,我已经安装了一个带有这个configuration的web服务器: Nginx 1.0.5 带PHP-FMP的PHP 5.3.6 Mysql 5.1.62 我在这台服务器上安装了最新版本的joomla,当我尝试上传一个安装包(包含joomla的扩展文件的zip文件)时,在nginx日志文件中出现以下错误:“502 Bad Gateway” 2012/05/13 11:22:21 [错误] 19911#0:* 20上游发送无效状态“-1复制失败”,从上游读取响应头时,客户端:10.10.56.70,server:localhost,request:“POST /administrator/index.php?option=com_installer&view=install HTTP / 1.1“,上行:”fastcgi://127.0.0.1:9000“,主机:”radio.xx.xx“,referrer:” http:// radio。 xx.xx / administrator / index.php?option = com_installer “ 我search了所有的互联网,我已经改变了太多的PHPconfiguration参数,FPMconfiguration和Nginx的configuration,包括增加执行时间等,但我的问题仍然存在。 我很确定它与我的Joomla没有任何关系,问题是在networking服务器,但没有可用的日志消息,除了上面的消息。 任何人都可以帮我解决这个问题吗?