Articles of php fpm

NGINX connect()unix:/var/run/php5-fpm/forums.socket失败

我最近用nginx,PHP-FPM重新设置了我的服务器。 我做了我一直做的,但现在的Nginx或PHP-FPM不处理PHP文件。 (我使用php phpinfo();)的最简单forms进行testing。 在我的VHOST的错误日志中,我得到: 2013/12/01 03:59:12 [crit] 1201#0: *5 connect() to unix:/var/run/php5-fpm/forums.socket failed (2: No such file or directory) while connecting to upstream, client: 173.245.53.199, server: forums.DOMAIN.DOM, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm/forums.socket:", host: "forums.DOMAIN.DOM", referrer: "http://forums.DOMAIN.DOM/" 有趣的是,在错误中提到的目录是在那里,但PHP的FPM或Nginx不生成在那里的套接字。 资源: http://paste.ubuntu.com/6502117/

Nginx + php-fpm auth_base上的url

晚上好。 我如何通过密码(auth_base)保护一些URL? 当我尝试写 location ^~ /test/ { auth_basic "admin login"; auth_basic_user_file /etc/nginx/httpd.passwd; location ~ \.php$ { include fastcgi.conf; fastcgi_pass наш-сокет; } } 什么都没有发生,但是在位置真实目录时 – 一切正常。 这是我的默认configuration: server { listen 80; server_name ~^(www\.)?test(?\d+)(?-alias)?.srv23.megaserver.umisoft.ru; root /home/testfarm/test$id/htdocs/; client_max_body_size 10m; rewrite_log on; access_log /home/testfarm/nginx_access.log; error_log /home/testfarm/nginx_error.log debug; location ~* \/\.ht { deny all; } location ~* ^\/(classes|errors\/logs|sys\-temp|cache|xmldb|static|packages) { deny […]

(111连接被拒绝),同时连接到上游

我有一个安装了nginx和php5-fpm的ubuntu 13.10服务器,服务器刚刚启动,因此我确信它不是缓冲区或连接超载问题。 我已经在可用站点中设置站点configuration并创build了sym链接: location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:7777; fastcgi_index index.php; include fastcgi_params; } HTML页面是可访问的,因此这不是一个nginx主机问题,这是一个php后端问题。 在我的php5 / fpm / pool.d中,我的www.conf的listen = 127.0.0.1:7777 根据需要,php5-fpm和nginx都已经重启。 如果我尝试在网站{url} /test.php上运行任何php页面,并且我得到连接拒绝和502浏览器错误 请任何人都可以帮助我,我一直试图让这个工作几个小时。

PHP应用程序生成的path不正确在Fedora nginx php-fpm安装程序中

我最近在Fedora的nginx + php-fpm安装程序中遇到了一些PHP应用程序的问题。 我本来就是跟Owncloud有这个问题的,创造了一个问题,没有太多的运气 ,但我意识到这是一个全球性的问题。 我今天尝试安装Drupal,并且遇到了与之前相同的问题。 我的nginx服务器块是这样的: server { listen 80; server_name domainname.com; root /var/www/whatever; index index.php; location / { try_files $uri $uri/ =404; #Recommended by Drupal docs for "Clean URLs" error_page 404 = @drupal; } location ~ \.php$ { include fastcgi_params; fastcgi_index index.php; try_files $uri =404; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } #Recommended by […]

Nginx不redirect

我从Nginx开始,并且有很多问题,因为事情从Apache变成了Nginx。 现在我有一个在Symfony1.4开发的应用程序,因为我得到了一个404 Not Found错误,所以不起作用。 这是错误的日志: 2014/02/07 21:28:49 [error] 2091#0: *22 open() "/var/www/html/apps/monitor/web/index.php/login" failed (20: Not a directory), client: 192.168.3.1, server: devserver, request: "POST /apps/monitor/web/index.php/login HTTP/1.1", host: "devserver", referrer: "http://devserver/apps/monitor/web/" 2014/02/07 21:29:11 [error] 2091#0: *22 open() "/var/www/html/apps/monitor/web/login" failed (2: No such file or directory), client: 192.168.3.1, server: devserver, request: "GET /apps/monitor/web/login HTTP/1.1", host: "devserver" 这是我的/etc/nginx/conf.d/default.conf文件的内容: server […]

nginx / php-fpm“主要脚本未知”从一个复杂的path服务时

我有一个web应用程序(simpleSAML.php)包装在一个Wordpress小部件,需要服务path如下: http://example.com/wp-content/plugins/saml-20-single-sign-on/saml/www/module.php/saml/sp/metadata.php/1 我的WordPress的nginxconfiguration工作正常,但需要服务上面的复杂path的部分没有。 它返回“文件未find”,并在nginx日志中发布“主脚本未知”错误。 这是我在vhostconfiguration中的: server { listen 80 default; server_name *.example.com example.com; root /srv/web/wpmulti; access_log /var/log/nginx/example.access.log; error_log /var/log/nginx/example.error.log; index index.html; location / { index index.html index.htm index.php; include global/restrictions.conf; include global/wordpress-ms-subdir.conf; rewrite ^ http://example.com$request_uri permanent; } location /wp-content/plugins/saml-20-single-sign-on/saml { alias /srv/web/wpmulti/wp-content/plugins/saml-20-single-sign-on/saml/www; location ~* /saml/(?<script>.+?\.php.*)(?<pathinfo>.*)?$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_NAME /saml/$script; […]

第一次访问nginx&php-fpm非常慢

我有一个nginx 1.4.5 web服务器与运行在我的服务器上的php-fpm 5.5.7,但如果我的服务器保持闲置一段时间,访问它是非常缓慢的。 得到响应(第一个字节)需要大约10-20秒,之后再快速。 我不知道为什么需要一段时间后回访第一次访问。 我试了两个unix套接字和tcp,没有效果。 inheritance人我的configuration: NGINX: user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1000; multi_accept on; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65s; keepalive_requests 1000; gzip […]

仅当在Fedora 20上作为系统服务运行时,才会出现PHP-FPM错误(未find文件/未find主脚本)

我试图在Fedora 20盒子上用PHP-FPM设置NGINX, 只有当启动php-fpm作为系统服务时,我才得到“File not found / Primary script unknown”错误。 我在默认的fastcgi.conf中使用了NGINX的默认设置。 (使用: fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; ) 这里是相关的nginx.conf: root /var/www/index; index index.html index.php index.htm; location ~ \.php$ { try_files $uri = 404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi.conf; } 现在,当我直接从shell(以root身份)启动php-fpm时,一切正常,但是当我使用systemctl start php-fpm.service fpm systemctl start php-fpm.service我得到“文件未find/主脚本未知”错误。 这里是php-fpm.service的定义: [Unit] Description=The PHP FastCGI Process Manager After=syslog.target network.target [Service] Type=notify […]

Codeigniter URL仅适用于默认路由器

我已经在这个configuration上在Nginx上安装了Codeigniter: server { listen 80; server_name myserver; root /usr/share/nginx/html; index index.php index.html index.htm; error_log /var/log/nginx/localhost.error_log debug; location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { expires max; log_not_found off; } location / { try_files $uri $uri/ /index.php?/$request_uri; location = /index.php { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name; include fastcgi_params; } } location ~ /\.ht { deny all; } } 我也用这种方式改变了ceodeignigter的configuration: … […]

nginx重写或内部redirect,主脚本未知

我正在从Apache转换为Nginx。 有关的应用程序如下 / contentlibrary_js /contentlibrary_js/app/index.php – >一页ajax应用程序/contentlibrary_js/pagecreator/index.php – > codeigniter应用程序后端 我希望有一个服务器块处理请求到前端和请求到后端。 通过以下configuration,我在nginx错误日志中收到“重写或内部redirect周期,同时在内部redirect到”/index.php“。 我试图添加第二个位置块来处理对pagecreator / index.php文件的请求,但是我然后应用程序挂起等待响应,并且在读取来自上游的响应标头时,我得到“在stderr中发送的FastCGI:”主脚本未知“在错误日志中。 任何build议,谢谢 server { server_name contentlib.dev; #access_log logs/leonardo.access.log main; root /Users/acasanova/projects/mednet/contentlibrary_js; index index.html index.htm index.php; try_files $uri $uri/ /pagecreator/index.php /index.php /index.php$uri /index.php?$args; # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # Codeigniter # location /pagecreator/{ # try_files $uri […]