重启后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
最满意答案
对于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机器。 这就是“一次编写,无处不在编译”,我认为这是一个很好的词汇组合。 否则,标记行可能是“编写一次,编译所有内容”。 回 ...
-
Qt的替代品[已关闭](Alternatives to Qt [closed])[2024-05-23]
以下是一些基于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 ...
-
尝试SQLite: http : //sqlite.org Try SQLite : http://sqlite.org
-
Qt跨平台开发?(Qt cross-platform development?)[2022-04-01]
您可以使用应用程序提供所需的动态库,如下所述: 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 ...
-
Qt安装程序框架(Qt Installer Framework)[2022-05-30]
要为您的应用程序构建安装程序,请不要编译安装程序框架,只需使用预编译的安装程序。 它包含以下文件[/ 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.