After PHP7 installation and try run
ERROR:failed to open configuration file ‘/private/etc/php-fpm.conf’: No such file or directory..
It is due to the configuration file with the path /private/etc/php-fpm.conf and the file does not exist.
To solve this
cp /private/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
After copying this file, you need to modify some of the things in this php-fpm.conf file
Note that there is an error_log, the default directory is /usr/var/…, but there is no such path in the mac directory, so if you run php-fpm at this time, you will get an error:
We can modify this configuration code:
error_log = /usr/local/var/log/php-fpm.log
Similarly, modify the pid:
pid = /usr/local/var/run/php-fpm.pid
Note that the last line of this configuration file is:
will read all files in the /private/etc/php-fpm.d/ directory with the .conf suffix, and the .conf file does not exist, so we copy one directly. /private/etc/php-fpm.d/www.conf.defaultIs /private/etc/php-fpm.d/www.conf.Just fine.
$ php-fpm –fpm-config /usr/local/etc/php-fpm.conf
If an error occurs:
ERROR: unable to bind listening socket for address ’127.0.0.1:9000′: Address
This shows that 127.0.0.1:9000 has been bound and can be resolved by the command killall php-fpm