Articles of php fpm

分割错误nginx + php5-fpm

我有关于分段错误的问题。 我正在运行Debian + Nging + Php5-fpm + Mysql + Imagemagick。 如何找出脚本(或程序)导致分段错误? 我需要一个非常简单的分步说明。 我search谷歌和所有可用的insructions是专业人士 – “如果你有一个核心文件做这个..”,连接debugging器“等 在我的情况下,分段错误是不规则的。 有时我只有一天有10段的错误,但有时候我几个月没有。 我没有任何有时只运行的脚本。 如果是脚本问题,我每天必须有数百个段错误。 那么,为什么segfaults有时只发生? 段错误最常见的情况是什么? 。 [28-May-2013 21:33:51] WARNING: [pool www] child 19448 exited on signal 11 (SIGSEGV) after 3514.206284 seconds from start [28-May-2013 21:33:56] WARNING: [pool www] child 20302 exited on signal 11 (SIGSEGV) after 4.462827 seconds from […]

我无法通过NGiNX执行PHP文件

这里是我从浏览器调用的configuration: location ~ ^/getfileinfo/(.*)$ { proxy_pass http://127.0.0.1/editionspanda_conn/$1; } 这是我的configuration,调用PHP文件: server { listen 127.0.0.1:80; server_name 127.0.0.1; root /var/www/localhost/public/; include /var/nginx/general/php; location ~ ^/editionspanda_conn/(.*)$ { root /var/www/EditionsPanda/livres.editionspanda.com/; try_files $uri $uri/ /index.php; fastcgi_pass unix:/var/run/php5-fpm.sock; } } 在浏览器中,我得到这个错误: File not found. 在我的错误日志中,我得到: 2013/09/09 22:12:20 [error] 8922#0: *2784 FastCGI sent in stderr: "Primary script unknown" while reading response header from […]

'找不到'在nginx和php-fpm中的确切path

有时在configurationnginx和php-fpm时,我得到消息“找不到文件”。 我知道这是由于错误的参数SCRIPT_FILENAME,例如: fastcgi_param SCRIPT_FILENAME /some/path$fastcgi_script_name; 我不知道是否有一种方法来获得确切的完整path的文件,这是不能find的php-fpm? 我的php5-fpm.log没有任何内容,但是: [06-Jan-2014 11:14:33] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [06-Jan-2014 11:27:01] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful 我已经尝试将php-fpm.conf中的log_level选项更改为error和debug ,但结果保持不变 PS这一行: add_header X-My-Header /some/path$fastcgi_script_name; 不会这样做,因为add_header只能用于成功的响应,正如我在这里阅读的 有nginx模块 ,即使有失败响应也可以设置头文件,但我认为它应该是一个更简单的方法来获取文件path。 谢谢。

包含zf2 / php文件的多个子目录的nginxconfiguration不起作用

我的根结构看起来像这样 / root / / root / projectA / … / root / projectB / … / root / projectC / … 在我的nginx文件中为每个子目录configuration一个额外的位置块之前, 这些位置“块”看起来像这样: server { listen 80; listen [::]:80; root /usr/share/root/projectA/public/; index index.php index.html index.cgi; server_name www.test.de; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param […]

我应该如何configurationnGinx来提供一个简单的PHP应用程序(路由问题)?

我试图configuration我的nGinx服务器(在Debian Wheezy框中)来服务我的小型PHP应用程序。 我有路由问题。 我需要什么: / – 不允许使用PHP,只是.html文件 / api – 所有内容都转到/api/index.php,包括/ api / method1,/ api / method2等 就这样。 我现在有什么: server { listen 3000; root /home/my_user/php/my_app; index index.html index.htm; # Make site accessible from http://localhost/ server_name localhost; location / { try_files /index.html =404; } location /api { try_files /index.php =404; } location ~ \.php$ { fastcgi_split_path_info […]

Nginx服务错误的网站

我有一个静态IP和2个域名(beryju.org和nope.berlin)在我的VPS的nginx设置。 我想服务: 网站1到beryju.org 网站2到blog.beryju.org 站点3到i.beryju.org 站点4到nope.berlin 另外我想要beryju.org和blog.beryju.org支持SSL。 但是用我目前的configuration,我得到: 网站1没有 网站2在beryju.org和blog.beryju.org上 i.beryju.org网站3 网站4 nope.berlin 我试过了,当我从listen语句中删除主机名时也不起作用 listen i.beryju.org:80; 至 listen 80; 在每个文件中。 beryjuorg-blog.conf server { listen blog.beryju.org:80; listen blog.beryju.org:443 ssl; ssl_certificate /home/beryju/SSL/nginx/beryju.org.cert; ssl_certificate_key /home/beryju/SSL/nginx/beryju.org.key; access_log /var/log/nginx/beryjuorg-blog.access.log; error_log /var/log/nginx/beryjuorg-blog.error.log; root /home/beryju/Apps/Ghost/; index index.html index.htm index.php; location / { proxy_pass http://127.0.0.1:2368; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For […]

如何防止nginxcaching空白页面?

我有一个Ubuntu 12.04机器上运行的nginx 1.4.3。 我有nginx设置caching页面(他们是数据库驱动,但保持相当静态)。 我正在使用MySQL和PHP-FPM。 但是,我发现我会间歇性地获取空白页面caching。 没有任何错误,只要从/var/cache/nginx删除相应的文件,页面就会回来。 经过一番调查,我发现问题是,如果收到一个HEAD请求,nginxcaching一个空的响应作为该URL的完整响应。 所以HEAD /example在/example页面的caching文件中存储一个空白文件,后续的GET /example返回一个空白页面。 (我似乎经常从各种search引擎和机器人获得HEAD请求。) 这里是相关的网站configuration: location ~ \.php$ { try_files $uri =404; fastcgi_cache one; fastcgi_cache_key $scheme$host$request_uri; fastcgi_cache_valid 200 5m; fastcgi_cache_valid 301 302 304 12h; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/www/mysite/public$fastcgi_script_name; fastcgi_param HTTPS off; } 这是一个在Nginx中的已知错误? 通过各种search,我还没有find任何有关这方面的信息。 有没有解决方法? 根据这个,无法防止cachingHEAD请求。 我想也许有一些'请求方法'variables可以添加到fastcgi_cache_key ,以便HEAD和GET请求分开caching。 但我什么都找不到

php-fpm / nginx给脚本错误的path信息

我使用一个nginxnetworking服务器,我一直试图阻止一个问题,其中网站被赋予错误的$_SERVER["PHP_SELF"]variables。 这打破了一些脚本。 问题似乎是nginx给FPM提供了错误的variables。 $_SERVER["PHP_SELF"]是“/index.php/index.php”,它应该是“/index.php” 这是nginx服务器的PHPconfiguration… server { listen 192.168.0.3:80; server_name cacti; access_log /home/admin/cacti_access_log; error_log /home/admin/cacti_error_log; root /var/www/sites/cacti; location / { index index.php index.html index.htm; } location ~* \.php$ { fastcgi_pass unix:/var/run/php-fpm/admin-socket; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; fastcgi_read_timeout 60; } } fastcgi_params … fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD […]

应该光油点击触摸PHP?

我有一个相当大的Drupal网站坐在一个4GB的内存盒子上光油。 我曾经想过(希望?假设?)在Nginx / PHP-FPM之前站在Varnish的位置将会减轻PHP的负担,但是PHP似乎仍然非常活跃,并且我得到了更多的警告:内存已经超过了90%预计会得到。 我从根本上误解了什么Varnish? 我的期望是,它将caching完整的HTTP响应,只是caching它,如果所请求的URL在caching中,就不会向Nginx发送请求,更不用说PHP了。 然而,在和我所知道的有关这个话题的人们交谈的时候,我正在得到一些可能会指出的信息。 任何人都可以填补这些差距? 在Drupal站点中, 绝大多数stream量是匿名的,因此受到光油caching的影响,我们应该期望从Varnish中获得什么? UPDATE 根据请求,这里是我的configuration( default.vcl – 也在一个要点 ): backend default { .host = "127.0.0.1"; .port = "8080"; } acl purge { # Add local/internal server IPs "localhost"; "127.0.0.1"; } sub vcl_recv { if (req.http.User-Agent ~ "MS Search (5|6).0 Robot") { error 403 "Forbidden"; } if (req.http.User-Agent ~ […]

Nginx托pipepath追加到index.php

我在Concrete5上托pipe一个实例,除了使用dynamicpath之外,他们还使用www.mysite.com/index.php/path/to/page奇怪forms的URL。 我主要工作,但我有问题得到Nginx服务请求www.mysite.com/ ,因为它列出的目录,而不是显示index.php 。 www.mysite.com/ – >列出public目录,但应显示index.php www.mysite.com/index.php/path/to/page – >作品! www.mysite.com/some/other/path->作品! 这是我的Nginx conf文件: server { root /srv/www/mysite.com/public_html; server_name mysite.com location / { try_files $uri $uri/ /index.php/$request_uri; autoindex on; # just for debugging… } location ~ \.php($|/) { set $script $uri; if ($uri ~ "^(.+\.php)(/.+)") { set $script $1; } include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$script; fastcgi_intercept_errors […]