首页 \ 问答 \ 重启后1-2分钟从php-fpm“未指定输入文件”(“No input file specified” from php-fpm for 1-2 min after restart)

重启后1-2分钟从php-fpm“未指定输入文件”(“No input file specified” from php-fpm for 1-2 min after restart)

使用php-fpm和nginx,一切正常,除了重启php-fpm后大约1-2分钟。 在此期间,将为所有 .php URL返回“未指定输入文件”。 1-2分钟后,一切都恢复正常,无需采取进一步行动。

/var/log/nginx/error.log中的示例条目:

2014/03/04 09:21:22 [error] 1206#0: *55 FastCGI sent in stderr: "Unable to open primary script: /usr/share/nginx/html (Success)", client: xxx.aaa.bbb.ccc, server: www.example.com, request: "GET /xxx/index.php HTTP/1.1", host: "www.example.com"

这是来自server.conf的服务器块:

server {
    listen       443 ssl;
    server_name  www.example.com;

    ssl_certificate      /etc/nginx/ssl-bundle.crt;
    ssl_certificate_key  /etc/nginx/cert.key;

    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;

    root /usr/share/nginx/html;
    index  index.php index.html;

    location / {
      try_files $uri $uri/ $uri/index.php;
    }

    location ~ \.php {
      fastcgi_split_path_info ^(.+\.php)(.+)$;
      fastcgi_param PATH_INFO $fastcgi_path_info;
      fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
      fastcgi_pass php;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;
    }
}

和/etc/nginx/nginx.conf:

http {
    ...

    sendfile        on;

    keepalive_timeout  65;
    charset utf-8;
    gzip on;
    gzip_static on;
    etag on;
    upstream php {
      server unix:/var/run/php5-fpm.sock;
    }
    open_file_cache max=1000 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors on;
    keepalive_requests 100000;
    expires max;

    include /etc/nginx/conf.d/*.conf;
}

任何想法如何解决它? 重启php-fpm后只发生一段时间的事实似乎排除了一些常见的问题(例如权限),看起来更像是缓存? 谢谢!


Using php-fpm with nginx, everything works OK, except for about 1-2 minutes after php-fpm is restarted. During that period, "No input file specified" is returned for all .php URLs. After 1-2 minutes, everything goes back to normal without further action.

Example entry in /var/log/nginx/error.log:

2014/03/04 09:21:22 [error] 1206#0: *55 FastCGI sent in stderr: "Unable to open primary script: /usr/share/nginx/html (Success)", client: xxx.aaa.bbb.ccc, server: www.example.com, request: "GET /xxx/index.php HTTP/1.1", host: "www.example.com"

Here's the server block from server.conf:

server {
    listen       443 ssl;
    server_name  www.example.com;

    ssl_certificate      /etc/nginx/ssl-bundle.crt;
    ssl_certificate_key  /etc/nginx/cert.key;

    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;

    root /usr/share/nginx/html;
    index  index.php index.html;

    location / {
      try_files $uri $uri/ $uri/index.php;
    }

    location ~ \.php {
      fastcgi_split_path_info ^(.+\.php)(.+)$;
      fastcgi_param PATH_INFO $fastcgi_path_info;
      fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
      fastcgi_pass php;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;
    }
}

And /etc/nginx/nginx.conf:

http {
    ...

    sendfile        on;

    keepalive_timeout  65;
    charset utf-8;
    gzip on;
    gzip_static on;
    etag on;
    upstream php {
      server unix:/var/run/php5-fpm.sock;
    }
    open_file_cache max=1000 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors on;
    keepalive_requests 100000;
    expires max;

    include /etc/nginx/conf.d/*.conf;
}

Any ideas how to fix it? The fact that it is only happening for a brief period after restarting php-fpm seems to rule out some common problems (e.g. permissions) and seems more like caching? Thanks!


原文:https://stackoverflow.com/questions/22176267
更新时间:2022-03-09 21:03

最满意答案

对于Windows和Unix,请使用InstallJammer。

对于Mac OS X,请使用Qt自带的工具:macdeployqt。 在这里更详细地阅读它。 此应用程序将添加所有必需的框架,并在控制台的一次调用中从您的应用程序构建一个DMG。

如果您有任何资源文件(如图像或XML文件等)要与应用程序一起分发,请直接使用Qt资源系统将它们编译到您的应用程序中。 这样可以更轻松地在所有平台上分发您的应用。


For Windows and Unix, use InstallJammer.

For Mac OS X, use the tool that comes with Qt itself: macdeployqt. Read about it in more detail here. This application will add all the required frameworks and build a DMG out of your app in one call from the console.

If you have any resource files (like images, or XML files etc) that you want to distribute with your application, compile them into your application directly with the Qt resource system. This will make it easier to distribute your app, on all platforms.

相关问答

更多
  • Qt的口号是: 写一次,随处编译。 考虑到这一点,Qt并未正式提供任何开箱即用的解决方案,用于将Qt应用程序从特定平台交叉编译到其他不同平台。 尽管绝对可行,但如果投入大量工作和时间,Qt良好的惯例会建议您直接在目标平台上构建您的Qt应用程序。 这意味着,将您的应用程序的Windows目标设置为Windows机器,Mac机器上的Mac目标以及Linux目标,您猜对了(:-))Linux机器。 这就是“一次编写,无处不在编译”,我认为这是一个很好的词汇组合。 否则,标记行可能是“编写一次,编译所有内容”。 回 ...
  • 以下是一些基于C / C ++的跨平台GUI框架: Qt的 wxWidgets的 GTK + FLTK 狐狸 终极++ JUCE GUI Toolkit框架页面包含许多语言和平台的GUI框架信息。 Here are a few C/C++ based cross-platform GUI frameworks: Qt wxWidgets GTK+ FLTK FOX Ultimate++ JUCE The GUI Toolkit, Framework Page contains information abo ...
  • 我不知道一个框架,这样做。 但是您可以编写自己的安装程序,即Java,它应该在大多数Windows和Mac安装上运行,因为它们中的大多数已经安装了Java。 另请注意,在Mac OSX上,通常情况下,应用程序只是一个带有后缀.app的文件夹,并且独立于它所在的位置运行,因此安装基本上只是拖放此.app文件夹(其中在用户/系统的Applications文件夹中显示为finder中的单个文件。 I am not aware of a framework, which does that. But you cou ...
  • 您可以使用应用程序提供所需的动态库,如下所述: http : //doc.qt.io/qt-5/deployment.html 由于Qt不是系统库,因此必须与应用程序一起重新分发; 最小的是重新分配应用程序使用的库的运行时。 但是,使用静态链接,Qt运行时被编译到可执行文件中。 You can deliver the dynamic libs you need with your application, as it's described here: http://doc.qt.io/qt-5/deplo ...
  • 对于Windows和Unix,请使用InstallJammer。 对于Mac OS X,请使用Qt自带的工具:macdeployqt。 在这里更详细地阅读它。 此应用程序将添加所有必需的框架,并在控制台的一次调用中从您的应用程序构建一个DMG。 如果您有任何资源文件(如图像或XML文件等)要与应用程序一起分发,请直接使用Qt资源系统将它们编译到您的应用程序中。 这样可以更轻松地在所有平台上分发您的应用。 For Windows and Unix, use InstallJammer. For Mac OS ...
  • 通常,应用程序和共享库之间的唯一区别是图像文件中的一些选项位。 所以,是的,您当然可以使用Qt编写可重用的软件库。 以下是警告: 如果您创建的库公开C ++接口(而不是C接口),则您的用户将需要使用相同的编译器版本来构建与您的库链接的代码。 C接口必须声明为extern C 如果您使用的库是动态链接到Qt,那么您的用户被迫使用Qt的二进制兼容版本:这意味着它必须使用相同的编译器进行编译,并且不需要进行二进制不兼容的更改 。 为了在非包管理平台(如Windows)上使用,我将我的库静态链接到Qt和Visual ...
  • 这取决于你的确切愿望,但理想情况下,你可以做到这两点。 其他发行版的Rpms,debs和类似包更容易获取和安装。 但是,有时需要花费一段时间才能将软件放入其软件包存储库中。 在这些情况下,像Qt这样的安装程序确实很方便。 It depends on your exact desire, but ideally, you could do both. Rpms, debs, and similar packages for other distributions are easier to obtain an ...
  • 要为您的应用程序构建安装程序,请不要编译安装程序框架,只需使用预编译的安装程序。 它包含以下文件[/ bin]: archivegen.exe binarycreator.exe installerbase.exe repogen.exe 还有一些例子,这里是下载1.4.0版本的链接http://download.qt-project.org/official_releases/qt-installer-framework/1.4.0/ To build an installer for your Appl ...
  • 你可以使用install4J来做同样的事情 。 You can use install4J for the same.

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)