Articles of php fpm

带有php-fpm的Nginx突然开始返回504 Gateway Time-out

我们有一个在Azure平台上运行的暂存Ubuntu服务器,只是突然开始超时。 我们前几天创build了服务器,并且工作得很好。 今天突然间,它刚刚开始返回504s。 我们已经重新启动了nginx和php-fpm,但它仍然不能正常工作。 我们已经尝试从我们的私钥中删除密码短语,就像其他一些答案所说,但它没有解决问题。 任何帮助或疑难解答的build议将不胜感激。 另外让我知道是否有另一个configuration文件,你需要看到。 提前致谢! 我们的/var/log/nginx/error.log: 2014/09/12 14:11:33 [emerg] 3854#0: SSL_CTX_use_PrivateKey_file("/etc/ssl/ssl.key/myserver.key") failed (SSL: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt error:0906A065:PEM routines:PEM_do_header:bad decrypt error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib) 2014/09/12 14:12:49 [error] 3887#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: {MY_IP}, server: {OUR_DOMAIN}, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock", host: […]

将PHP5-FPM错误传回错误页脚本?

我的nginx有一个error_page设置,会向PHP页面抛出500个错误。 我希望显示/logging导致此错误页面显示的任何PHP错误。 当我说显示,我的意思是显示在浏览器根据用户的凭据。 澄清:我想检索有关在PHP中发生的确切的错误的具体细节,不只是有一个错误。 这可能使用PHP5-FPM和nginx ?

Joomla URL重写在Nginx中自动运行

这是驱使我坚果,我不明白这是如何工作自动。 我有nginx作为我的networking服务器,我已经安装了URL重写的Joomla从URL删除index.php 。 之前,当我使用Apache时,必须使用RewriteEngine On启用.htaccess才能使其工作。 但对于Nginx,当启用“使用URL重写”时,它会自动运行。 我只使用将php文件传递给php-fpm的Nginx。 就这样。 我没有添加任何特殊的重写规则,而不是Joomla文档中给出的。 我不明白“启用URL重写”是如何自动启用的,因为Nginx没有.htaccess。 关于这个主题的Joomla文档没有帮助。 它在第二步说 启用使用Apache mod_rewrite / URL重写选项并保存:此选项使用Apache mod_rewrite函数来消除URL的“index.php”部分。 ….. 如果此选项导致错误,请参阅如何检查您的服务器上是否启用了mod重写。 如果未启用,并且您有权访问文件apache / conf / httpd.conf,请打开该文件并检查LoadModule行rewrite_module modules / mod_rewrite.so是否未注释。 如有必要,取消注释该行并重新启动Apache Web服务器。 不知道为什么这是在Nginxconfiguration中添加的,因为在Nginx中没有mod_rewrite。 Joomla后端的URL重写如下: 使用URL重写select使用服务器的重写引擎来捕获满足特定条件的URL,并按照指示重写它们。 适用于IIS 7和Apache。 仅限Apache用户! 激活之前,将htaccess.txt重命名为.htaccess。 将web.config.txt重命名为web.config,然后在激活之前安装IIS URL重写模块。 它没有提到Nginx,但仍然有效。 我在这里挠着脑袋。 有人能告诉我Joomla的index.php如何轻松地在Nginx中删除? 这是我的Nginx Vhostconfiguration: server { listen 80; server_name example.com; root /var/www/example/public_html; index index.php index.html index.htm […]

为什么安装了旧版本的Nginx?

我安装了Nginx和PHP5-FPM,并且一切正常,但是我注意到我安装了Nginx 1.2.1,而不是最新的稳定版本(1.6.x)。 我也注意到PHP-FPM有PHP 5.4而不是PHP 5.5。 但是,这不像旧的Nginx版本那么多的安全问题。 我如何安装: 添加deb http://nginx.org/packages/debian/ wheezy nginx到/etc/apt/sources.list 。 我也正确地添加了PGP密钥。 su apt-get update在更新期间列出了Nginx服务器,并且没有错误。 apt-get install nginx-extras php5-fpm 然后我configuration了两个我喜欢的。 我也意识到我有一个旧版本的Nginx。 我做了apt-cache show nginx-common ,看到了旧版本。 我试图apt-get upgrade无济于事。 apt-cache show nginx-common输出apt-cache show nginx-common : Package: nginx-common Source: nginx Version: 1.2.1-2.2+wheezy3 Installed-Size: 203 Maintainer: Kartik Mistry <[email protected]> Architecture: all Replaces: nginx (<< 0.8.54-4), nginx-extras (<< 0.8.54-4), […]

FastCGI:只有一个特定的文件“通信服务器中止:读取失败”

相关问题: FastCGI和Apache 500错误间歇性 该解决scheme不适合我。 问题: 我有一台Laravel 5.1应用程序(在其他服务器上生产,没有任何问题),运行在新的Ubuntu 14.04服务器上,使用Apache 2.4.7和PHP,通过PHP-FPM运行 。 只要在应用程序中不调用某个文件,一切工作正常: $compiledPath = __DIR__.'/cache/compiled.php'; if (file_exists($compiledPath)) { require $compiledPath; // this causes a "500 Internal Server Error" } 这是一个由框架自动创build的Laravel特定文件,用于加快速度(所以这不是我的代码中的错误),它确实存在,我有完全的访问权限。 它的大小约为600kB 。 当我删除它,一切工作正常。 但是,当我告诉Laravel再次创build它,然后点击应用程序的任何path时,出现以下日志条目的“500内部服务器错误”: [fastcgi:error] [pid 14334](104)通过peer重置连接:[client xxx.xxx.xxx.xxx:41395] FastCGI:与服务器通信“/ var / www / clients / client1 / web1 / cgi-bin / php5-fcgi-yyy.yyy.yyy.yyy-80-domain.com“中止:读取失败 [fastcgi:error] [pid 14334] [client […]

504在nginx上使用PHP进行网关超时

我正在尝试从运行Apache的开发计算机将PHP Laravel应用程序移动到运行nginx的服务器。 我已经configuration了数据库连接,而我的Laravel应用程序(主要是)用期望的页面进行响应。 但是,服务器没有快速响应并返回一个随机的时间 504 Gateway Time-out 一段时间后。 一个 service php5-fpm restart 或者稍后再尝试修复这个暂时的。 我在PHP 5.6(通过FPM),HHVM和MySQL使用nginx。 我不想增加最大的执行时间,因为脚本不应该花这么长的时间。 我怀疑这是在新的环境中的PHP脚本或configuration问题的问题。 这不应该是nginx本身的问题,因为静态资源发送正确。 我如何解决和解决这个问题?

PHP 7和5.6在Nginx中并行

我想将PHP 7与更新的应用程序一起使用,将PHP 5.6与应用程序一起使用,但不支持PHP 7.所以,我尝试configurationNginx来为不同的程序启用不同的PHP版本。 但它不起作用: # should enable PHP5 for all PHP-scripts under /vexim/ path location ^~ /vexim/.*\.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php5-fpm.sock; } 而任何其他的默认应该是PHP 7: location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } 有了这个configuration,/ vexim /下的PHP脚本根本就不被parsing。 如何使这个工作与不同的pathes和PHP版本? (使用Debian 8.3 Jessie,Nginx 1.8.1(dotdeb),PHP 5.6,PHP 7(dotdeb))

FastCGI发送stderr:“主要脚本未知”+ Owncloud

我遇到了一个奇怪的错误,我的nginx / php5-fpmconfiguration。 我已经在自己的云论坛上发布了这个问题,并且问了nginx论坛,但是他们不知道。 当我searchserverfault时,关于这个主题的build议并不直接适用于我的问题,因为他们都共享一个错误configuration的位置块,我认为,在这里是不是这种情况(我从自己的云文档直接configuration)。 那么问题是什么? 我的nginx error.log填充了这些: "FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: MY IP, server: MY DOMAIN, request: "GET /core/img/actions/history.svg HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "MY HOSTNAME/DOMAIN", referrer: "MY DOMAIN" Owncloud运行在一个子目录/srv/www/owncloud,根目录指向/srv/www 。 如果我把相同的configuration指向root /srv/www/owncloud ; 同样的错误是造成,但这次它读取: FastCGI sent in stderr: "Primary script unknown" while reading response […]

PHP的路由URL到index.php nginx

我正在运行一个nginx / php5.6-fpm服务器,我有以下几点 server { listen 10080; listen [::]:10080; root /home/vagrant/app; index index.php; server_name mia-dev.dev; port_in_redirect on; rewrite ^/static/(.*)$ /dist/static/$1 permanent; location / { try_files $uri $uri/ /index.php?$query_string; } # load the index page on 404 error_page 404 /index.php; # don't log requests to favicon.ico location = /favicon.ico { log_not_found off; access_log off; } # […]

在Debian 8.6虚拟机 – 服务器块(虚拟主机)问题上设置nginx 1.10.1

大家好,问候。 首先感谢您抽出宝贵的时间来回顾并回答我的问题。 非常感谢。 或多或less,我正在使用新的虚拟机(Google Cloud Computing)设置所有设置,并尝试使用Debian,nginx,mariadb,php。 我已经在虚拟机上多次尝试过这种types的设置,但是这次我决定在使用apt-get的时候得到最新版本的nginx(1.10.1)而不是Debian的默认软件包安装nginx而不更新源列表。 (我相信一个就像1.6.3)。 虽然两者之间的差异是最小的,但我注意到的一件事是这个版本的nginx不使用服务器块(Vhosts)的/ sites-enabled /和/ sites-available /文件夹,它直接进入/ etc / nginx / conf.d /文件夹。 没问题,我想。 现在我的情况是我正在工作的网站organiplan点com显示404页面没有find,尽pipe它似乎像我的服务器块和nginx.conf文件安装正确。 我将在下面包括。 服务器块 server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /var/www/html/organiplan.com/public_html; index index.php index.html index.htm; server_name organiplan.com www.organiplan.com; client_max_body_size 1024m; location / { try_files $uri $uri/ /index.php?q=$request_uri; } error_page 404 /404.html; error_page […]