Note: mac comes with apache environment and PHP environment
Start-up and shut down a service of php
php-fpm start
sudo php-fpm
php-fpm Close
1 View php-fpm port is in the process php-fpm
netstat -an | grep 9000
View the process pid
sudo lsof -i:9000
Kill the process
sudo kill -9 [pid] 或者 sudo killall php-fpm
2 view the process to get the primary process ID
ps aux | grep php-fpm
Kill the process
sudo kill -USR2 main process ID
Note: S + representatives of the child process, i.e. process mainly represented Ss, i.e. root or master process corresponding to the main number is
restart php-fpm
Turn off the php-fpm, and then start
Start-up and shut down two apache services
apache start
sudo apachectl -k start
apache Close
sudo apachectl -k stop
Restart apache
sudo apachectl -k restart
It is given three to start:
1 apache start when an error does not affect the use of
Error message:
httpd: apr_sockaddr_info_get() failed for duaijingdeMacBook-Air.local
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
/Etc/httpd/conf/httpd.conf not set the ServerName so it will be replaced with the name of the host, will first go / etc / hosts host has not defined
problem solved:
Set the ServerName or fill in your own host name MYHOST in / etc / hosts in the comments and let go of the httpd.conf
Modify the hosts file
vi /etc/hosts
127.0.0.1 localhost.localdomain localhost (hostname)
Modify the httpd.conf file, comment open
we /etc/apache2/httpd.conf
ServerName localhost:80
That's all for this time!