I'm using multiple versions of PHP (7.2 and 7.4) in Mac OS. So I use PHP-fpm
to work with 7.4 version. few weeks before I went very well but now I got an error like
503 Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Then I checked my apache error log like below
[pid 13899] (61)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9074 (*) failed
[Fri Jul 31 17:42:39.724698 2020] [proxy_fcgi:error] [pid 13899] [client 127.0.0.1:51458] AH01079: failed to make connection to backend: localhost
My virtual host configurations are given below
<VirtualHost *:80>
ServerName project.test
ServerAlias www.project.test
ServerAdmin web@project
DocumentRoot "/Library/WebServer/Documents/projects/my_project/public/"
# ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9074//Library/WebServer/Documents/projects/my_project/public/$1
ErrorLog "/var/log/apache2/project-error_log"
CustomLog "/var/log/apache2/project-access_log" common
# RewriteEngine on
<FilesMatch \.php$>
# SetHandler application/x-httpd-php
SetHandler proxy:fcgi://localhost:9074
</FilesMatch>
<Directory "/Library/WebServer/Documents/projects/my_project">
Options +FollowSymLinks
AllowOverride All
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</Directory>
<Directory "/Library/WebServer/Documents">
ErrorDocument 404 /404.php
ErrorDocument 403 /404.php
#RedirectMatch 404 /*.sh$|/*.bak$|/vendor//*|/\.git*|/db/*|/DB_OLD/*|/composer.json|/composer.lock|/composer.phar$
</Directory>
</VirtualHost>
part of www.conf given below
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr/local/Cellar/php/7.4.0) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = jithinvijayan
group = staff
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9074
Note: Today I created one Laravel project after that I run the composer update command I got an error like Composer: PHP Fatal error: Allowed memory size exhausted
but I fixed that issue with memory limit configurations in php.ini
.