FCGI: attempt to connect to 127.0.0.1:9000 (*) failed Apache 2.4, PHP7.1-FPM with unix socket












0















I am trying to set up PHP7.1-FPM on MacOS Mojave! I followed this guide and got all the way through to the end when it stopped working.



During searching Google I decided to try and use unix sockets instead, so some of my configuration differs slightly to the guide I tried to follow.



I've got my services installed:



$ sudo brew services list
Name Status User Plist
httpd started root /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
php@7.1 started root /Library/LaunchDaemons/homebrew.mxcl.php@7.1.plist


I've set up my httpd.conf:



#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.php index.html index.htm
</IfModule>

<VirtualHost *:*>
ProxyPassMatch "^/(.*.php(/.*)?)$" "fcgi://127.0.0.1:9000/usr/local/var/www/$1"
</VirtualHost>
<FilesMatch .php$>
SetHandler "proxy:unix:/usr/var/run/php7.1-fpm.sock|fcgi://localhost/"
</FilesMatch>


In my /etc/php-fpm.d/www.conf I've got



listen = /var/run/php/php7.1-fpm.sock


If I check for the processes it seems all good:



$ ps aux | grep php-fpm                        10.2s  Thu 17 Jan 14:15:40 2019
finnlesueur 3718 0.0 0.0 4268052 692 s001 S+ 12:28pm 0:00.01 tail -f /usr/local/var/log/php-fpm.log
finnlesueur 30588 0.0 0.0 4268060 812 s000 S+ 2:15pm 0:00.00 grep --color=auto php-fpm
_www 29371 0.0 0.0 4520960 1180 ?? S 2:08pm 0:00.00 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize
_www 29370 0.0 0.0 4520960 1080 ?? S 2:08pm 0:00.00 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize
root 29366 0.0 0.1 4518912 30808 ?? Ss 2:08pm 0:00.08 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize

$ ps aux | grep httpd
finnlesueur 29346 0.0 0.0 4345112 1832 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
root 29332 0.0 0.0 4309296 2720 ?? Ss 2:08pm 0:00.09 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
finnlesueur 30727 0.0 0.0 4268060 812 s000 S+ 2:16pm 0:00.00 grep --color=auto httpd
finnlesueur 29350 0.0 0.0 4328728 1172 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
finnlesueur 29349 0.0 0.0 4345112 1180 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
finnlesueur 29348 0.0 0.0 4353304 1184 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
finnlesueur 29347 0.0 0.0 4335896 1192 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND


My DocumentRoot has an index.php where it's just echoing phpinfo(); and that also seems fine, but when I load localhost I see 503 Service Unavailable and in my HTTP error log I get:



[Thu Jan 17 14:18:57.654807 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(817): [client ::1:57866] AH01626: authorization result of Require all granted: granted
[Thu Jan 17 14:18:57.654991 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(817): [client ::1:57866] AH01626: authorization result of <RequireAny>: granted
[Thu Jan 17 14:18:57.655083 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(845): [client ::1:57866] AH01628: authorization result: granted (no directives)
[Thu Jan 17 14:18:57.655119 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(108): [client ::1:57866] AH01060: set r->filename to proxy:fcgi://127.0.0.1:9000/usr/local/var/www/index.php
[Thu Jan 17 14:18:57.655162 2019] [proxy:debug] [pid 29347] mod_proxy.c(1246): [client ::1:57866] AH01143: Running scheme fcgi handler (attempt 0)
[Thu Jan 17 14:18:57.655171 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(1019): [client ::1:57866] AH01076: url: fcgi://127.0.0.1:9000/usr/local/var/www/index.php proxyname: (null) proxyport: 0
[Thu Jan 17 14:18:57.655183 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(1028): [client ::1:57866] AH01078: serving URL fcgi://127.0.0.1:9000/usr/local/var/www/index.php
[Thu Jan 17 14:18:57.655191 2019] [proxy:debug] [pid 29347] proxy_util.c(2313): AH00942: FCGI: has acquired connection for (*)
[Thu Jan 17 14:18:57.655199 2019] [proxy:debug] [pid 29347] proxy_util.c(2367): [client ::1:57866] AH00944: connecting fcgi://127.0.0.1:9000/usr/local/var/www/index.php to 127.0.0.1:9000
[Thu Jan 17 14:18:57.655219 2019] [proxy:debug] [pid 29347] proxy_util.c(2576): [client ::1:57866] AH00947: connected /usr/local/var/www/index.php to 127.0.0.1:9000
[Thu Jan 17 14:18:57.655346 2019] [proxy:error] [pid 29347] (61)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9000 (*) failed
[Thu Jan 17 14:18:57.655367 2019] [proxy_fcgi:error] [pid 29347] [client ::1:57866] AH01079: failed to make connection to backend: 127.0.0.1
[Thu Jan 17 14:18:57.655375 2019] [proxy:debug] [pid 29347] proxy_util.c(2328): AH00943: FCGI: has released connection for (*)


And nothing makes it to my PHP-FPM log, I guess because the connection has not been made.



I've been Googling for hours but can't seem to find anything that works. Any help would be appreciated!



Let me know if there's extra information I can provide!



Update 1



$ sudo lsof -U | grep php
php-fpm 29366 root 5u unix 0xf497a489280ca0c1 0t0 ->0xf497a489280c91e9
php-fpm 29366 root 6u unix 0xf497a489280c91e9 0t0 ->0xf497a489280ca0c1
php-fpm 29366 root 7u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock
php-fpm 29370 _www 8u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock
php-fpm 29371 _www 8u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock









share|improve this question



























    0















    I am trying to set up PHP7.1-FPM on MacOS Mojave! I followed this guide and got all the way through to the end when it stopped working.



    During searching Google I decided to try and use unix sockets instead, so some of my configuration differs slightly to the guide I tried to follow.



    I've got my services installed:



    $ sudo brew services list
    Name Status User Plist
    httpd started root /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
    php@7.1 started root /Library/LaunchDaemons/homebrew.mxcl.php@7.1.plist


    I've set up my httpd.conf:



    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    <IfModule dir_module>
    DirectoryIndex index.php index.html index.htm
    </IfModule>

    <VirtualHost *:*>
    ProxyPassMatch "^/(.*.php(/.*)?)$" "fcgi://127.0.0.1:9000/usr/local/var/www/$1"
    </VirtualHost>
    <FilesMatch .php$>
    SetHandler "proxy:unix:/usr/var/run/php7.1-fpm.sock|fcgi://localhost/"
    </FilesMatch>


    In my /etc/php-fpm.d/www.conf I've got



    listen = /var/run/php/php7.1-fpm.sock


    If I check for the processes it seems all good:



    $ ps aux | grep php-fpm                        10.2s  Thu 17 Jan 14:15:40 2019
    finnlesueur 3718 0.0 0.0 4268052 692 s001 S+ 12:28pm 0:00.01 tail -f /usr/local/var/log/php-fpm.log
    finnlesueur 30588 0.0 0.0 4268060 812 s000 S+ 2:15pm 0:00.00 grep --color=auto php-fpm
    _www 29371 0.0 0.0 4520960 1180 ?? S 2:08pm 0:00.00 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize
    _www 29370 0.0 0.0 4520960 1080 ?? S 2:08pm 0:00.00 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize
    root 29366 0.0 0.1 4518912 30808 ?? Ss 2:08pm 0:00.08 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize

    $ ps aux | grep httpd
    finnlesueur 29346 0.0 0.0 4345112 1832 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
    root 29332 0.0 0.0 4309296 2720 ?? Ss 2:08pm 0:00.09 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
    finnlesueur 30727 0.0 0.0 4268060 812 s000 S+ 2:16pm 0:00.00 grep --color=auto httpd
    finnlesueur 29350 0.0 0.0 4328728 1172 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
    finnlesueur 29349 0.0 0.0 4345112 1180 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
    finnlesueur 29348 0.0 0.0 4353304 1184 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
    finnlesueur 29347 0.0 0.0 4335896 1192 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND


    My DocumentRoot has an index.php where it's just echoing phpinfo(); and that also seems fine, but when I load localhost I see 503 Service Unavailable and in my HTTP error log I get:



    [Thu Jan 17 14:18:57.654807 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(817): [client ::1:57866] AH01626: authorization result of Require all granted: granted
    [Thu Jan 17 14:18:57.654991 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(817): [client ::1:57866] AH01626: authorization result of <RequireAny>: granted
    [Thu Jan 17 14:18:57.655083 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(845): [client ::1:57866] AH01628: authorization result: granted (no directives)
    [Thu Jan 17 14:18:57.655119 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(108): [client ::1:57866] AH01060: set r->filename to proxy:fcgi://127.0.0.1:9000/usr/local/var/www/index.php
    [Thu Jan 17 14:18:57.655162 2019] [proxy:debug] [pid 29347] mod_proxy.c(1246): [client ::1:57866] AH01143: Running scheme fcgi handler (attempt 0)
    [Thu Jan 17 14:18:57.655171 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(1019): [client ::1:57866] AH01076: url: fcgi://127.0.0.1:9000/usr/local/var/www/index.php proxyname: (null) proxyport: 0
    [Thu Jan 17 14:18:57.655183 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(1028): [client ::1:57866] AH01078: serving URL fcgi://127.0.0.1:9000/usr/local/var/www/index.php
    [Thu Jan 17 14:18:57.655191 2019] [proxy:debug] [pid 29347] proxy_util.c(2313): AH00942: FCGI: has acquired connection for (*)
    [Thu Jan 17 14:18:57.655199 2019] [proxy:debug] [pid 29347] proxy_util.c(2367): [client ::1:57866] AH00944: connecting fcgi://127.0.0.1:9000/usr/local/var/www/index.php to 127.0.0.1:9000
    [Thu Jan 17 14:18:57.655219 2019] [proxy:debug] [pid 29347] proxy_util.c(2576): [client ::1:57866] AH00947: connected /usr/local/var/www/index.php to 127.0.0.1:9000
    [Thu Jan 17 14:18:57.655346 2019] [proxy:error] [pid 29347] (61)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9000 (*) failed
    [Thu Jan 17 14:18:57.655367 2019] [proxy_fcgi:error] [pid 29347] [client ::1:57866] AH01079: failed to make connection to backend: 127.0.0.1
    [Thu Jan 17 14:18:57.655375 2019] [proxy:debug] [pid 29347] proxy_util.c(2328): AH00943: FCGI: has released connection for (*)


    And nothing makes it to my PHP-FPM log, I guess because the connection has not been made.



    I've been Googling for hours but can't seem to find anything that works. Any help would be appreciated!



    Let me know if there's extra information I can provide!



    Update 1



    $ sudo lsof -U | grep php
    php-fpm 29366 root 5u unix 0xf497a489280ca0c1 0t0 ->0xf497a489280c91e9
    php-fpm 29366 root 6u unix 0xf497a489280c91e9 0t0 ->0xf497a489280ca0c1
    php-fpm 29366 root 7u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock
    php-fpm 29370 _www 8u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock
    php-fpm 29371 _www 8u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock









    share|improve this question

























      0












      0








      0








      I am trying to set up PHP7.1-FPM on MacOS Mojave! I followed this guide and got all the way through to the end when it stopped working.



      During searching Google I decided to try and use unix sockets instead, so some of my configuration differs slightly to the guide I tried to follow.



      I've got my services installed:



      $ sudo brew services list
      Name Status User Plist
      httpd started root /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
      php@7.1 started root /Library/LaunchDaemons/homebrew.mxcl.php@7.1.plist


      I've set up my httpd.conf:



      #
      # DirectoryIndex: sets the file that Apache will serve if a directory
      # is requested.
      #
      <IfModule dir_module>
      DirectoryIndex index.php index.html index.htm
      </IfModule>

      <VirtualHost *:*>
      ProxyPassMatch "^/(.*.php(/.*)?)$" "fcgi://127.0.0.1:9000/usr/local/var/www/$1"
      </VirtualHost>
      <FilesMatch .php$>
      SetHandler "proxy:unix:/usr/var/run/php7.1-fpm.sock|fcgi://localhost/"
      </FilesMatch>


      In my /etc/php-fpm.d/www.conf I've got



      listen = /var/run/php/php7.1-fpm.sock


      If I check for the processes it seems all good:



      $ ps aux | grep php-fpm                        10.2s  Thu 17 Jan 14:15:40 2019
      finnlesueur 3718 0.0 0.0 4268052 692 s001 S+ 12:28pm 0:00.01 tail -f /usr/local/var/log/php-fpm.log
      finnlesueur 30588 0.0 0.0 4268060 812 s000 S+ 2:15pm 0:00.00 grep --color=auto php-fpm
      _www 29371 0.0 0.0 4520960 1180 ?? S 2:08pm 0:00.00 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize
      _www 29370 0.0 0.0 4520960 1080 ?? S 2:08pm 0:00.00 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize
      root 29366 0.0 0.1 4518912 30808 ?? Ss 2:08pm 0:00.08 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize

      $ ps aux | grep httpd
      finnlesueur 29346 0.0 0.0 4345112 1832 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      root 29332 0.0 0.0 4309296 2720 ?? Ss 2:08pm 0:00.09 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      finnlesueur 30727 0.0 0.0 4268060 812 s000 S+ 2:16pm 0:00.00 grep --color=auto httpd
      finnlesueur 29350 0.0 0.0 4328728 1172 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      finnlesueur 29349 0.0 0.0 4345112 1180 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      finnlesueur 29348 0.0 0.0 4353304 1184 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      finnlesueur 29347 0.0 0.0 4335896 1192 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND


      My DocumentRoot has an index.php where it's just echoing phpinfo(); and that also seems fine, but when I load localhost I see 503 Service Unavailable and in my HTTP error log I get:



      [Thu Jan 17 14:18:57.654807 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(817): [client ::1:57866] AH01626: authorization result of Require all granted: granted
      [Thu Jan 17 14:18:57.654991 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(817): [client ::1:57866] AH01626: authorization result of <RequireAny>: granted
      [Thu Jan 17 14:18:57.655083 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(845): [client ::1:57866] AH01628: authorization result: granted (no directives)
      [Thu Jan 17 14:18:57.655119 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(108): [client ::1:57866] AH01060: set r->filename to proxy:fcgi://127.0.0.1:9000/usr/local/var/www/index.php
      [Thu Jan 17 14:18:57.655162 2019] [proxy:debug] [pid 29347] mod_proxy.c(1246): [client ::1:57866] AH01143: Running scheme fcgi handler (attempt 0)
      [Thu Jan 17 14:18:57.655171 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(1019): [client ::1:57866] AH01076: url: fcgi://127.0.0.1:9000/usr/local/var/www/index.php proxyname: (null) proxyport: 0
      [Thu Jan 17 14:18:57.655183 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(1028): [client ::1:57866] AH01078: serving URL fcgi://127.0.0.1:9000/usr/local/var/www/index.php
      [Thu Jan 17 14:18:57.655191 2019] [proxy:debug] [pid 29347] proxy_util.c(2313): AH00942: FCGI: has acquired connection for (*)
      [Thu Jan 17 14:18:57.655199 2019] [proxy:debug] [pid 29347] proxy_util.c(2367): [client ::1:57866] AH00944: connecting fcgi://127.0.0.1:9000/usr/local/var/www/index.php to 127.0.0.1:9000
      [Thu Jan 17 14:18:57.655219 2019] [proxy:debug] [pid 29347] proxy_util.c(2576): [client ::1:57866] AH00947: connected /usr/local/var/www/index.php to 127.0.0.1:9000
      [Thu Jan 17 14:18:57.655346 2019] [proxy:error] [pid 29347] (61)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9000 (*) failed
      [Thu Jan 17 14:18:57.655367 2019] [proxy_fcgi:error] [pid 29347] [client ::1:57866] AH01079: failed to make connection to backend: 127.0.0.1
      [Thu Jan 17 14:18:57.655375 2019] [proxy:debug] [pid 29347] proxy_util.c(2328): AH00943: FCGI: has released connection for (*)


      And nothing makes it to my PHP-FPM log, I guess because the connection has not been made.



      I've been Googling for hours but can't seem to find anything that works. Any help would be appreciated!



      Let me know if there's extra information I can provide!



      Update 1



      $ sudo lsof -U | grep php
      php-fpm 29366 root 5u unix 0xf497a489280ca0c1 0t0 ->0xf497a489280c91e9
      php-fpm 29366 root 6u unix 0xf497a489280c91e9 0t0 ->0xf497a489280ca0c1
      php-fpm 29366 root 7u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock
      php-fpm 29370 _www 8u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock
      php-fpm 29371 _www 8u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock









      share|improve this question














      I am trying to set up PHP7.1-FPM on MacOS Mojave! I followed this guide and got all the way through to the end when it stopped working.



      During searching Google I decided to try and use unix sockets instead, so some of my configuration differs slightly to the guide I tried to follow.



      I've got my services installed:



      $ sudo brew services list
      Name Status User Plist
      httpd started root /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
      php@7.1 started root /Library/LaunchDaemons/homebrew.mxcl.php@7.1.plist


      I've set up my httpd.conf:



      #
      # DirectoryIndex: sets the file that Apache will serve if a directory
      # is requested.
      #
      <IfModule dir_module>
      DirectoryIndex index.php index.html index.htm
      </IfModule>

      <VirtualHost *:*>
      ProxyPassMatch "^/(.*.php(/.*)?)$" "fcgi://127.0.0.1:9000/usr/local/var/www/$1"
      </VirtualHost>
      <FilesMatch .php$>
      SetHandler "proxy:unix:/usr/var/run/php7.1-fpm.sock|fcgi://localhost/"
      </FilesMatch>


      In my /etc/php-fpm.d/www.conf I've got



      listen = /var/run/php/php7.1-fpm.sock


      If I check for the processes it seems all good:



      $ ps aux | grep php-fpm                        10.2s  Thu 17 Jan 14:15:40 2019
      finnlesueur 3718 0.0 0.0 4268052 692 s001 S+ 12:28pm 0:00.01 tail -f /usr/local/var/log/php-fpm.log
      finnlesueur 30588 0.0 0.0 4268060 812 s000 S+ 2:15pm 0:00.00 grep --color=auto php-fpm
      _www 29371 0.0 0.0 4520960 1180 ?? S 2:08pm 0:00.00 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize
      _www 29370 0.0 0.0 4520960 1080 ?? S 2:08pm 0:00.00 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize
      root 29366 0.0 0.1 4518912 30808 ?? Ss 2:08pm 0:00.08 /usr/local/opt/php@7.1/sbin/php-fpm --nodaemonize

      $ ps aux | grep httpd
      finnlesueur 29346 0.0 0.0 4345112 1832 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      root 29332 0.0 0.0 4309296 2720 ?? Ss 2:08pm 0:00.09 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      finnlesueur 30727 0.0 0.0 4268060 812 s000 S+ 2:16pm 0:00.00 grep --color=auto httpd
      finnlesueur 29350 0.0 0.0 4328728 1172 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      finnlesueur 29349 0.0 0.0 4345112 1180 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      finnlesueur 29348 0.0 0.0 4353304 1184 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND
      finnlesueur 29347 0.0 0.0 4335896 1192 ?? S 2:08pm 0:00.00 /usr/local/opt/httpd/bin/httpd -D FOREGROUND


      My DocumentRoot has an index.php where it's just echoing phpinfo(); and that also seems fine, but when I load localhost I see 503 Service Unavailable and in my HTTP error log I get:



      [Thu Jan 17 14:18:57.654807 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(817): [client ::1:57866] AH01626: authorization result of Require all granted: granted
      [Thu Jan 17 14:18:57.654991 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(817): [client ::1:57866] AH01626: authorization result of <RequireAny>: granted
      [Thu Jan 17 14:18:57.655083 2019] [authz_core:debug] [pid 29347] mod_authz_core.c(845): [client ::1:57866] AH01628: authorization result: granted (no directives)
      [Thu Jan 17 14:18:57.655119 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(108): [client ::1:57866] AH01060: set r->filename to proxy:fcgi://127.0.0.1:9000/usr/local/var/www/index.php
      [Thu Jan 17 14:18:57.655162 2019] [proxy:debug] [pid 29347] mod_proxy.c(1246): [client ::1:57866] AH01143: Running scheme fcgi handler (attempt 0)
      [Thu Jan 17 14:18:57.655171 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(1019): [client ::1:57866] AH01076: url: fcgi://127.0.0.1:9000/usr/local/var/www/index.php proxyname: (null) proxyport: 0
      [Thu Jan 17 14:18:57.655183 2019] [proxy_fcgi:debug] [pid 29347] mod_proxy_fcgi.c(1028): [client ::1:57866] AH01078: serving URL fcgi://127.0.0.1:9000/usr/local/var/www/index.php
      [Thu Jan 17 14:18:57.655191 2019] [proxy:debug] [pid 29347] proxy_util.c(2313): AH00942: FCGI: has acquired connection for (*)
      [Thu Jan 17 14:18:57.655199 2019] [proxy:debug] [pid 29347] proxy_util.c(2367): [client ::1:57866] AH00944: connecting fcgi://127.0.0.1:9000/usr/local/var/www/index.php to 127.0.0.1:9000
      [Thu Jan 17 14:18:57.655219 2019] [proxy:debug] [pid 29347] proxy_util.c(2576): [client ::1:57866] AH00947: connected /usr/local/var/www/index.php to 127.0.0.1:9000
      [Thu Jan 17 14:18:57.655346 2019] [proxy:error] [pid 29347] (61)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9000 (*) failed
      [Thu Jan 17 14:18:57.655367 2019] [proxy_fcgi:error] [pid 29347] [client ::1:57866] AH01079: failed to make connection to backend: 127.0.0.1
      [Thu Jan 17 14:18:57.655375 2019] [proxy:debug] [pid 29347] proxy_util.c(2328): AH00943: FCGI: has released connection for (*)


      And nothing makes it to my PHP-FPM log, I guess because the connection has not been made.



      I've been Googling for hours but can't seem to find anything that works. Any help would be appreciated!



      Let me know if there's extra information I can provide!



      Update 1



      $ sudo lsof -U | grep php
      php-fpm 29366 root 5u unix 0xf497a489280ca0c1 0t0 ->0xf497a489280c91e9
      php-fpm 29366 root 6u unix 0xf497a489280c91e9 0t0 ->0xf497a489280ca0c1
      php-fpm 29366 root 7u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock
      php-fpm 29370 _www 8u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock
      php-fpm 29371 _www 8u unix 0xf497a489280c9a81 0t0 /var/run/php/php7.1-fpm.sock






      macos apache-http-server php






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 17 at 2:05









      Finn LeSueurFinn LeSueur

      162




      162






















          1 Answer
          1






          active

          oldest

          votes


















          1














          It was, in the end, a simple mistake.



          I was editing a www.conf file at /etc/php-fpm.d/www.conf which turns out to be there from the default MacOS installation.



          The www.conf file for PHP7.1-FPM that I installed with Brew was at:
          /usr/local/etc/php/7.1/php-fpm.d/www.conf.



          Once I changed the listen directive at /usr/local/etc/php/7.1/php-fpm.d/www.conf I was off to the races.






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395195%2ffcgi-attempt-to-connect-to-127-0-0-19000-failed-apache-2-4-php7-1-fpm-wit%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            It was, in the end, a simple mistake.



            I was editing a www.conf file at /etc/php-fpm.d/www.conf which turns out to be there from the default MacOS installation.



            The www.conf file for PHP7.1-FPM that I installed with Brew was at:
            /usr/local/etc/php/7.1/php-fpm.d/www.conf.



            Once I changed the listen directive at /usr/local/etc/php/7.1/php-fpm.d/www.conf I was off to the races.






            share|improve this answer






























              1














              It was, in the end, a simple mistake.



              I was editing a www.conf file at /etc/php-fpm.d/www.conf which turns out to be there from the default MacOS installation.



              The www.conf file for PHP7.1-FPM that I installed with Brew was at:
              /usr/local/etc/php/7.1/php-fpm.d/www.conf.



              Once I changed the listen directive at /usr/local/etc/php/7.1/php-fpm.d/www.conf I was off to the races.






              share|improve this answer




























                1












                1








                1







                It was, in the end, a simple mistake.



                I was editing a www.conf file at /etc/php-fpm.d/www.conf which turns out to be there from the default MacOS installation.



                The www.conf file for PHP7.1-FPM that I installed with Brew was at:
                /usr/local/etc/php/7.1/php-fpm.d/www.conf.



                Once I changed the listen directive at /usr/local/etc/php/7.1/php-fpm.d/www.conf I was off to the races.






                share|improve this answer















                It was, in the end, a simple mistake.



                I was editing a www.conf file at /etc/php-fpm.d/www.conf which turns out to be there from the default MacOS installation.



                The www.conf file for PHP7.1-FPM that I installed with Brew was at:
                /usr/local/etc/php/7.1/php-fpm.d/www.conf.



                Once I changed the listen directive at /usr/local/etc/php/7.1/php-fpm.d/www.conf I was off to the races.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 17 at 21:47

























                answered Jan 17 at 2:13









                Finn LeSueurFinn LeSueur

                162




                162






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395195%2ffcgi-attempt-to-connect-to-127-0-0-19000-failed-apache-2-4-php7-1-fpm-wit%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                    is 'sed' thread safe

                    How to make a Squid Proxy server?