Search code examples
phpnginxsolaris

php-fpm does't listen on port 9000 in solaris 11


I have installed php5.6 in solaris 11 by command

pkg install php-56

and installed nginx by command

pkgutil -i -y nginx

Now I want to configure /etc/php/5.6/php-fpm.conf to enable php-fpm listening on port by directive:

127.0.0.1:9000
listen.allowed_clients = 127.0.0.1

But when I restart nginx server,I found that port 9000 does't listen

# netstat -an -f inet
UDP: IPv4
   Local Address        Remote Address      State
-------------------- -------------------- ----------
      *.*                                 Unbound
      *.*                                 Unbound
      *.*                                 Unbound
      *.*                                 Unbound
      *.631                               Idle
      *.111                               Idle
      *.*                                 Unbound
      *.62866                             Idle
      *.111                               Idle
      *.*                                 Unbound
      *.52142                             Idle
      *.*                                 Unbound
      *.68                                Idle
      *.546                               Idle

TCP: IPv4
   Local Address        Remote Address     Swind  Send-Q  Rwind  Recv-Q    State
-------------------- -------------------- ------- ------ ------- ------ -----------
127.0.0.1.5999             *.*                  0      0  128000      0 LISTEN
127.0.0.1.631              *.*                  0      0  128000      0 LISTEN
      *.111                *.*                  0      0  128000      0 LISTEN
      *.*                  *.*                  0      0  128000      0 IDLE
      *.111                *.*                  0      0  128000      0 LISTEN
      *.*                  *.*                  0      0  128000      0 IDLE
      *.22                 *.*                  0      0  128000      0 LISTEN
      *.22                 *.*                  0      0  128000      0 LISTEN
127.0.0.1.25               *.*                  0      0  128000      0 LISTEN
127.0.0.1.587              *.*                  0      0  128000      0 LISTEN
127.0.0.1.4999             *.*                  0      0  128000      0 LISTEN
      *.3306               *.*                  0      0  128000      0 LISTEN
127.0.0.1.44881            *.*                  0      0  128000      0 LISTEN
192.168.0.60.22      192.168.0.8.49263     131008      0  128872      0 ESTABLISHED

And I found that nginx does't process php correctly. Could any one tell me how to start php-fpm in solaris 11?Any suggestions should be appreciated!


Solution

  • Problem resolved! Solaris use spawn-fcgi instead php-fpm,for example

    #/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u nobody -f /usr/bin/php-cgi
    

    Please refer to nginx-php-solaris-10