Articles of FastCGI的

如何在nginx虚拟主机中添加open_basedirpath

在php.ini中我已经设置 open_basedir = /home/user/web/ 现在我想在一个需要包含/ usr / share / phppgadmin文件的子域上运行phppgadmin。 所以我在这个主机的nginx-config中添加了下面一行: fastcgi_param PHP_VALUE open_basedir="/home/user/web/:/usr/share/phppgadmin/"; 并重新启动了nginx。 但是,由于以下错误,我无法访问该网站: (错误)31440#0:* 1在stderr中发送了FastCGI:“PHP警告:include_once():open_basedir限制有效,文件(/usr/share/phppgadmin/libraries/lib.inc.php)不在允许的path( / home / user / web /)在/usr/share/phppgadmin/info.php在第10行 可能是第二条路不在这里列出的原因? 还有什么需要添加open_basedir到虚拟主机? 我只使用/ sites-available中的默认文件。 编辑总是想到重新启动fpm … service php5-fpm restart

无法在Apache上安装PHP-FPM(无法连接到FastCGI服务器)

我一直有问题安装php-fpm与apache2-mpm-worker 。 他是我所遵循的向导 。 根据指南的步骤5, Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization 但是我找不到/usr/lib php5-fcgi ,只能find/usr/bin/php5-cgi和/usr/bin/php-cgi ,我不确定它们是否相同。 所以我改变了第5步的内容: Alias /php5-fcgi /usr/bin/php5-fcgi FastCgiExternalServer /usr/bin/php5-fcgi -host 127.0.0.1:9000 -pass-header 在重新启动Apache,它的日志给了错误: [notice] caught SIGTERM, shutting down [alert] (4)Interrupted system call: FastCGI: read() from pipe failed (0) [alert] (4)Interrupted system call: FastCGI: the PM is shutting down, Apache seems […]

去(lang)与nginx – 服务静态文件

目前我有以下用Go编写的HTTP服务器: func main() { http.HandleFunc("/", func(response http.ResponseWriter, request *http.Request) { http.ServeFile(response, request, "/var/www/default/htdocs/index.html") }) http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir("/var/www/default/htdocs/public")))) http.HandleFunc("/json", func(response http.ResponseWriter, request *http.Request) { // serves a JSON response }) http.HandleFunc("/socket", func(w http.ResponseWriter, r *http.Request) { // replies to the WebSocket }) http.ListenAndServe(":3000", nil) } 我已经看到了一些基准,表明nginx在静态文件方面每秒可以提供更多的请求。 nginx的另一个有用的function是它可以透明地gzip响应,甚至可以使用gzip_static模块提供预压缩的文件。 理想情况下,我希望nginx提供所有现有的(静态)文件,并将所有不存在的东西代理到Go: location / { try_files $uri $uri/ @go; } […]

在Windows 7中找不到angular色服务

我正在尝试在Windows 7 Home Premium上使用以下指令安装PHP: 使用FastCGI在IIS 7上托pipePHP应用程序 和页面上的三分之一的方式,我必须这样做: Server Manager -> Roles -> Add Role Services 只是找不到angular色或angular色服务。 有任何想法吗? PHP给了我一个500错误,我想知道是否因为我没有做这个angular色服务的事情。

没有Apache / Nginx / CGI堆栈的PHP服务器

在许多语言中,您可以从头开始构buildWeb框架(即从unix套接字)和抽象层。 如果我想在OCaml或C中从零开始构buildWeb框架,我首先构build一个侦听端口80的套接字服务器。 就像我之前想到的那样,PHP和其他更高级的语言一样可能会以某种方式包装unix套接字。 现在我知道这是从来没有如何devisePHP的情况。 不过,我不明白为什么从来没有这样用过。 沿着同样的路线,PHP解释器不会像Python解释器那样以这种方式使用。 例如,当我从零开始构build一个Python Web服务器并进行部署时,我执行以下操作:在某个端口(例如8000)上连接一个unix套接字,守护程序如python server.py 8000 ,并在端口上有nginx反向代理80并转发到我的内部本地服务器端口8000.我从来没有看到这在PHP中完成,即使这是可能的。 我会承认,除了使用解释器独立(即龙卷风,uwsgi等)之外,您还有其他Python选项。 但是,这是两种方式。 我的问题是,PHP语言,解释器或社区的哪些方面阻止了PHP web框架从unix套接字调用完全build立起来,在本地端口上守护进程,并被反向代理而不是使用cgi / fastcgi包装?

使PHP-FPM在'IPAddress:Port'处听,而不是'/var/run/php5-fpm.sock;'

正如我今天负载testing我的网站(使用blitz.io ); 尽pipe有大量的RAM(超过50%)和CPU能力(超过70%)可用,但结果表明,我的网站以每秒一定数量的并发用户开始超时。 我的网站(/var/log/nginx/example.com.error.log)的Nginx错误日志显示如下: 2013/02/12 19:03:57 [error] 13749#0:* 3175连接()到unix:/var/run/php5-fpm.sock失败(11:资源暂时不可用) 54.123.456.46,服务器:example.com,请求:“GET / HTTP / 1.1”,上游:“fastcgi:// unix:/var/run/php5-fpm.sock:”,主机:“example.com” 谷歌search的错误导致我这个答案 ,使用TCP \ IP连接,而不是unix套接字作为问题的解决scheme; 因为unix socket的“高负载情况下的问题是众所周知的” 。 所以,正如答案所build议的那样: 我用/etc/php5/fpm/pool.d/www.conf中的listen 127.0.0.1:9000replace了listen = /var/run/php5-fpm.sock 由于我的分配(Debian Wheezy)上没有/etc/nginx/php_location ,所以我什么也没做。 由于我使用fastcgi_pass unix:/var/run/php5-fpm.sock; 在我的网站的Nginxconfiguration文件中,即/etc/nginx/sites-available/example.com,我用fastcgi_pass 127.0.0.1:9000;取代了它fastcgi_pass 127.0.0.1:9000; 现在的问题是,当我访问我的网站时,出现502 Bad Gateway错误。 是的,我reload Nginx和PHP-FPM。 我究竟做错了什么? (这里总是新手,尽我所能去学习。) 如果这是相关的,当我做sudo service php5-fpm restart ,我得到这个错误: [FAIL] Restarting PHP5 FastCGI Process Manager: php5-fpm failed! […]

在Ubuntu Linode上使用Nginx的PHP错误(通过FastCGI)

我使用以下指南在Linode的Ubuntu 10.04服务器上设置LEMP(Linux,Nginx,MySQL和PHP): http : //library.linode.com/lemp-guides/ubuntu-10.04-lucid 本质上,我将我的PHP脚本上传到/srv/www/mysite.com/public_html指定的目录( /srv/www/mysite.com/public_html )。 在浏览器中访问该网站给我一个500内部服务器错误。 我假设有一些PHP代码的错误,这很好。 然而,我完全不知道如何debugging,因为有几个组件:PHP,FastCGI和Nginx。 我的问题是,如何获得这些错误显示在浏览器中,或至less在日志中,所以我可以弄清楚是怎么回事? 我不确定是否需要告诉Nginx在某处logging错误,或者FastCGI,或编辑php.ini。 我有完整的根服务器来解决这个问题。 不过,我不确定如何重新启动PHP / FastCGI(尽pipe我知道如何重新启动Nginx),因为我遵循的指南使用了某种守护进程。 谢谢你的帮助,你可以给我。

如何用lighttpdconfigurationfastcgi

我想用ligttpd服务器来configurationFastCgi。 我能够像这样运行vanilla lighttpd:./lighttpd -f lighttpd.conf 然后我编译/安装fastcgi的源代码,并在lighttpd.conf中添加以下内容: fastcgi.server = ( "/fastcgi_scripts/" => (( #"host" => "127.0.0.1", #"port" => 9091, "check-local" => "disable", "bin-path" => "/usr/local/bin/cgi-fcgi", "docroot" => "/" # remote server may use # it's own docroot )) ) 但是,我添加上面后,lighttpd不会启动。 你能告诉我如何使用lighttpd运行fastcgi? 我想用fastcgi和lighttpd一起使用ac程序。 谢谢。

mod_headers不适用于php + mod_fastcgi页面

我通过mod_fastcgi&mod_suexec运行PHP,并且在我的.htaccess文件中添加了Header set X-UA-Compatible "IE=edge env=best-standards-support" 。 它对静态内容工作正常,但PHP文件缺less标题。 我该如何解决这个问题?

php-cgi.exe和/或php5.dll崩溃 – PHP 5.2.17,Win2k8和IIS7

我的PHP脚本的一个特定部分随机崩溃,我不知道为什么。 这个页面和其他页面的唯一区别就是我正在做一个PDO SQLSRV调用。 但80%的时间没有问题,然后突然IIS7将开始吐出奇怪的500错误信息。 如果我回收应用程序池,它会再次正常工作。 以下是NT日志中的错误: HTTP Error 500.0 – Internal Server Error C:\PHP\php-cgi.exe – The FastCGI process exited unexpectedly Detailed Error Information Module FastCgiModule Notification ExecuteRequestHandler Handler PHP Error Code 0x000000ff Requested URL {removed} Physical Path {removed} Logon Method Anonymous Logon User Anonymous 我使用IIS7在Windows 2008 64位上运行非线程安全的PHP 5.2.17。 IIS应用程序池设置为允许32位应用程序,据我所知,FastCGI在IIS和php.ini中configuration正确 真的很感激任何人的build议。 谢谢。 Windows也生成了这个崩溃报告: Version=1 EventType=APPCRASH EventTime=129647371568690873 […]