douguyi3903
2016-05-24 09:46
浏览 84
已采纳

找不到nginx + php5-fpm.sock

I have several subdomains, each with a socket:

In /etc/php5/fpm/pool.d/album.conf ::

user = album
group = album
listen = /var/run/php5-fpm-album.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
php_admin_flag[allow_url_fopen] = off
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

In /etc/php5/fpm/pool.d/www.conf ::

user = www-data
group = www-data
listen = /var/run/php5-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660

In /etc/nginx/nginx.conf ::

upstream php5-fpm-album-sock {
    server unix:/var/run/php5-fpm-album.sock;
}

server {
            ## Escucha en el puerto 80 (HTTP)
            listen 80;

            ## Raíz donde se encuentra la página Web
            root /srv/www/album/;

            ## Orden de prioridad de los archivos index
            index index.php index.html index.htm;

            server_name album.bichomen.com;
            access_log /srv/www/album/access.log;

                location ~ \.php$ {
                   root /srv/www/album;
                   try_files $uri =404;
                   fastcgi_split_path_info ^(.+\.php)(/.+)$;
                   fastcgi_pass php5-fpm-album-sock;
                   fastcgi_index index.php;
                   fastcgi_param SCRIPT_FILENAME 
                   $document_root$fastcgi_script_name;
                   include fastcgi_params;
            }
    }

The problem is to disbelieve the socket in /var/run/

Error in nginx.log:

1 connect() to unix:/var/run/php5-fpm-album.sock failed 
(2: No such file or directory)

Where is the problem? Thank you.

图片转代码服务由CSDN问答提供 功能建议

我有几个子域,每个子域都有一个套接字:

在/etc/php5/fpm/pool.d/album.conf ::

  user = album 
group = album 
listen = / var / run /  php5-fpm-album.sock 
listen.owner = www-data 
listen.group = www-data 
listen.mode = 0660 
php_admin_value [disable_functions] = exec,passthru,shell_exec,system 
php_admin_flag [allow_url_fopen] = off \  npm = dynamic 
pm.max_children = 5 
pm.start_servers = 2 
pm.min_spare_servers = 1 
pm.max_spare_servers = 3 
chdir = / 
   
 
 

在/etc/php5/fpm/pool.d/www.conf ::

  user = www-data 
group = www-data 
listen =  /var/run/php5-fpm.sock
listen.owner = www-data 
listen.group = www-data 
listen.mode = 0660 
   
 
 

< strong>在/etc/nginx/nginx.conf ::

 上游php5-fpm-album-sock {
服务器unix:/ var / run /  php5-fpm-album.sock; 
} 
 
server {
 ## Escucha en el puerto 80(HTTP)
 听取80; 
 
 ##Raízdondese encuentralapáginaWeb
 root / srv / www / album /; 
 
 ## Orden de prioridad de los archivos index 
 index index.php index.html index  .htm; 
 
 server_name album.bichomen.com; 
 access_log /srv/www/album/access.log;
nn location~ \ .php $ {
 root / srv / www / album; \  n try_files $ uri = 404; 
 fastcgi_split_path_info ^(。+ \ .php)(/。+)$; 
 fastcgi_pass php5-fpm-album-sock; 
 fastcgi_index index.php; 
 fastcgi_param SCRIPT_FILENAME 
 $  document_root $ fastcgi_script_name; 
包括fastcgi_params; 
} 
} 
   
 
 

问题是不相信 / var / run /

nginx.log中的错误:

  1 connect()到unix:/ var / 运行/ php5-fpm-album.sock失败
(2:不 这样的文件或目录)
   
 
 

问题出在哪里? 谢谢。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • douyi4912 2017-06-08 06:59
    已采纳

    At the end restart the server and it works.

    点赞 评论
  • dongtan7351 2016-05-27 17:56

    ls -lah /var/run

    lrwxrwxrwx 1 root root 4 Feb 28  2015 /var/run -> /run
    

    I have created the directory php5-fpm:

    drwxrwxr-x  2 www-data www-data 40 May 24 14:52 php5-fpm
    

      and I have modified the configuration files:

    unix server: /var/run/php5-fpm/album.sock;
    
    点赞 评论
  • donk68254 2016-09-07 14:44
    1. change the php5-fpm.sock to php-fpm.sock
    2. restart the php-fpm service
    3. restart the nginx service
    点赞 评论

相关推荐 更多相似问题