Articles of FastCGI的

NGINX和PHP-FPM正在下载index.php而不是处理它

php-fpm正在运行: # /etc/init.d/php5-fpm status php5-fpm is running php-fpm正在监听: # netstat -an | grep :9000 tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN /etc/nginx/nginx.conf中的Nginxconfiguration: # Nginx web server main configuration file: /etc/nginx/nginx.conf # user www-data; worker_processes 8; pid /var/run/nginx.pid; events { multi_accept on; } http { default_type application/octet-stream; gzip on; gzip_disable "msie6"; keepalive_timeout 65; sendfile on; tcp_nodelay on; […]

php5-cgi给清漆502,但没有

问题总结: php5-fastcgi与nginx协同工作,但不支持nginx + varnish(502 Bad Gateway) 有没有人有什么我可以改变清漆工作的build议? 问题细节: 这是我的configuration: (听80)nginx(请求8181)==>(听8181)varnish ==>(听9090)php5-fastcgi /etc/nginx/conf.d/mydomain.com server { listen 80; server_name mydomain.com; index index.html index.htm index.php; keepalive_timeout 30; root /var/www/assets; location = /favicon.ico { log_not_found off; access_log off; } location ~\.php$ { root /var/www/api; add_header Access-Control-Allow-Origin *; fastcgi_pass 127.0.0.1:8181; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~ […]

nginx&PHP:别名块中的try_files

我有一个别名的nginx设置,并试图用try_files做一个重写规则。 问题在于它预先提供了文档根目录而没有find该文件。 组态: server { listen 80; server_name mysite.com; root /var/www/default; index index.html index.htm index.php; location /coolapp { alias /home/myhome/coolapp/www/; index index.php; try_files $uri $uri/ /home/myhome/coolapp/www/index.php?url=$uri&$args; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } } } 并在nginx错误日志中: [error] 21903#0: *2 open() "/var/www/default/home/myhome/coolapp/www/index.php" failed (2: No such file or directory) […]

如何正确防止504网关超时?

我有一个脚本可以运行大约15分钟,因为它是一个大型的数据迁移工具。 我有这个问题,如果我设置fastcgi_read_timeout 9900; 它永远不会超时,或者如果我把它设置为更less,那么在我的脚本完成运行之前超时。 编辑:我拿走了fastcgi_read_timeout 9900; 从nginx.conf设置max_execution_time = 1300; 在php.ini中,我现在得到一个504网关超时,而不是永远循环。 我怎样才能正确地设置页面应该是活的,直到脚本完成执行?

在ngninx上通过FastCGI运行WSAPI

使用Lua 5.2与wsapi 1.6-1和通过luarocks安装的wsapi-fcgi 1.6-1,我有以下的nginxconfiguration: server { listen 127.0.0.1:8080; server_name localhost; location / { root /home/petsagouris/code/wsapitest/; index index.html index.htm run.lua; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # Lua WSAPI # taken from http://mascarenhas.github.io/2009/10/24/wsapi-nginx-fcgi.html location ~ ^(.+\.lua)(.*)$ { root html; fastcgi_pass 127.0.0.1:9100; fastcgi_index run.lua; fastcgi_split_path_info ^(.+\.lua)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; […]

用于PHP的Apache FastCGI增加资源

我想在我的服务器上安装一个基于PHP的Web应用程序,但在安装过程中,我得到一个»500内部错误«。 在我通过networking进行search时,我发现发生这种情况是因为我的服务器的设置使用了FastCGI for PHP。 错误发生了,因为脚本超时时间太短,可能的内存数量也可能是PHP的问题。 所以我的问题是: 我怎样才能增加FastCGI的超时和可能的其他资源的PHP。 可以/etc/apache2/mods-available/fcgid.conf去哪里? 另外,在应用程序.htaccess我可以find这些行,但取消注释他们给了我»404没有find:«/ /cgi-bin/php5-cgi/index.php # Action php5-cgi /cgi-bin/php5-cgi # AddHandler php5-cgi .php 谢谢你! 更新 检查/var/log/apache2/error.log给了我这个: [Fri Nov 22 12:51:07 2013] [notice] mod_fcgid: call /home/xxxx/public_html/index.php with wrapper /home/xxxx/fcgi-bin/php5.fcgi PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cgi/conf.d/mcrypt.ini on line 1 in Unknown on line 0 [Fri Nov 22 12:51:49 […]

OpenVZ共享PHP5-FPM套接字

我需要在2个容器之间共享php5-fpm.sock 我有2个容器: 1.与NGINX 2.用PHP5和PHP5-FPM 通过NFS链接容器 我试过使用: 1. mount –bind / var / lib / vz / private / 100 / var / src_dir_with_socket / var / lib / vz / private / 101 / var / dst_dir_with_socket 2. moutn -t simfs … 3.纯粹的NFS 在NGINX容器上共享php5-fpm.sock – 不起作用 计划只有当我在端口上安装FPM我需要通过SOCKET工作 谢谢!

Nginx没有把uri传递给php5-fpm,而是作为文本文件

如上所述,uri没有被传递给nginx。 我已经包括了整个“尝试”块来显示这个。 location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. set $page_to_view "/index.php"; try_files $uri $uri.php $uri/; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } 所以它本质上是说:“噢,我们做了$ uri.php文件存在,让我们服务器,而不是实际发送到PHP。 我的fpm部分在下面。 # pass the PHP scripts to FastCGI server listening […]

使用Django App上的lighttpd和fastcgiredirect

我已经设置了我的lighttpd的方式,redirect到我的主域名的所有子域以下面的方式* .domain.com – > domain.com 。 不幸的是,当我input一个像www.domain.com这样的子域名时,它直接进入了http://domain.com/site.fcgi/并且从字面上打破了页面。 当我排除子域它打开完美的页面。 以下使用lighttpd设置: $HTTP["host"] =~ "\.domain\.com(:[0-9]+)?$" { url.redirect = ("^/(.*)" => "http://domain.com/$1") } $HTTP["host"] =~ "^domain\.com(:[0-9]+)?$" { server.document-root = "/var/www/servers/domain.com/awesomesite" accesslog.filename = "/var/www/logs/domain.com/access.log" server.errorlog = "/var/www/logs/domain.com/error.log" fastcgi.server = ( ".fcgi" => ( "main" => ( # Use host / port instead of socket for TCP fastcgi "bin-path" => "/var/www/servers/domain.com/awesomesite/domain.fcgi", […]

在虚拟主机中使用mod fastcgi为apache2.2设置HHVM

我想设置一个运行HHVM的虚拟主机来尝试新的“Facebook Hack”语言。 我遵循Apache 2.2的说明: https : //github.com/facebook/hhvm/wiki/FastCGI 目前hhvm是这样运行的: hhvm -ms -vServer.Type = fastcgi -vServer.Port = 9001 而我的虚拟主机configuration是: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com DocumentRoot /home/tijmen/sites/example.com php_value engine off #<IfModule fastcgi_module> Alias /hhvm.fastcgi /home/tijmen/sites/example.com/hhvm.fastcgi FastCGIExternalServer /home/tijmen/sites/example.com/hhvm.fastcgi -host 127.0.0.1:9001 <Directory "/home/tijmen/sites/example.com/"> <Files "hhvm.fastcgi"> Order deny,allow </Files> </Directory> RemoveHandler .php AddHandler hhvm-hack-extension .hh AddHandler hhvm-php-extension .php Action hhvm-hack-extension […]