MacLion10.7.2 install Nginx + PHP-FPMMacLion10.7.2 with MacPorts install Nginx + PHP-FPM with MacPorts? Sudoport-vselfupdate ?? Modify the PHP5 Portfile? Sudovioptlocalvarmacportssourcesrsy Mac Lion 10.7.2 install Nginx + PHP-FPM with MacPorts
Mac Lion 10.7.2 install Nginx + PHP-FPM with MacPorts
?
sudo port -v selfupdate
?
?
Modify the Portfile file of PHP5
?
sudo vi /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/lang/php5/Portfile
?
?
Find configure. args? Add a row:-enable-fpm
Find xinstall ....... Comment out php-cgi
?
?
sudo port install nginx php5 +fastcgi php5-apc php5-mysql +mysqlnd
?
?
Modify nginx configuration file
?
sudo cp /opt/local/etc/nginx/nginx.conf.example /opt/local/etc/nginx/nginx.conf sudo vi /opt/local/etc/nginx/nginx.conf
?
?
Modify the php-fpm configuration file
?
Sudo cp/opt/local/etc/php-fpm.conf.default/opt/local/etc/php-fpm.conf sudo vi/opt/local/etc/php-fpm.conf # find and edit the following content pid = run/php-fpm.pid error_log = log/php-fpm.log listen =/tmp/php-fpm.sock
?
?
Modify the php configuration file
sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.inisudo vi /opt/local/etc/php5/php.ini
?
?
Install extension
?
sudo port install php5-extension
?
Test the nginx configuration file
sudo nginx -t
?
Other related commands
# Start nginxsudo nginx # restart sudo-s reload # Close sudo-s stop # Test the php-fpm configuration file sudo php-fpm-t # start sudo php-fpm # immediately close (INT, TERM) sudo kill-INT 'cat/opt/local/var/run/php-fpm.pid '# smooth termination (QUIT) sudo kill-QUIT 'cat/opt/local/var/run/php-fpm.pid '# Restart (USR1, USR2) sudo kill-USR2 'cat/opt/local/var/run/php-fpm.pid'
??