Https://github.com/musicode/test/issues/5
The Mac comes with PHP-FPM, which executes at the terminal php-fpm
and reports the following error:
ERROR: failed to open configuration file ‘/private/etc/php-fpm.conf‘: No such file or directory (2)ERROR: failed to load configuration file ‘/private/etc/php-fpm.conf‘ERROR: FPM initialization failed
The error message shows that the configuration file cannot be opened, and cd /private/etc
no php-fpm.conf files are found, but there are php-fpm.conf.default files. This file is the default configuration, we can copy it, rename it to php-fpm.conf, and then change the configuration as needed.
cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf
Execution php-fpm
, again error:
ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2)ERROR: failed to post process the configurationERROR: FPM initialization failed
The error message shows that the error log file cannot be opened. Found that there is cd /usr/var/log
no such directory, even the Var directory is not, plus in order to avoid permissions problems, simply configure to the/usr/local/var/log directory.
Modify the php-fpm.conf error_log
configuration to, and change to, the same as the /usr/local/var/log/php-fpm.log
user
group
current user.
Execution php-fpm
, again error:
NOTICE: [pool www] ‘user‘ directive is ignored when FPM is not running as rootNOTICE: [pool www] ‘group‘ directive is ignored when FPM is not running as root
Then sudo php-fpm
, again the error:
ERROR: unable to bind listening socket for address ‘127.0.0.1:9000‘: Address already in use (48)ERROR: FPM initialization failed
Edit the php-fpm.conf and modify it listen
to 127.0.0.1:9999
.
Execution php-fpm -t
, the world is finally clean!
MAC Configuration php-fpm