php-fpm 是預裝在mac os上的,你只須要配置就行了。這個服務監聽9000端口。php
1. 爲配置文件準備一些目錄nginx
mkdir -p /usr/share/php/var/run mkdir -p /usr/share/php/var/log mkdir -p /usr/share/php/var/session
2. 修改配置文件session
cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf
找到pid等進行以下修改socket
pid = /usr/share/php/var/run/php-fpm.pid error_log = /usr/share/php/var/log/php-fpm.log ; 手動啓動就設置這個 不然 安裝daemon後臺運行並設置成yes daemonize = no ; optionally change listener from port to socket (will require tweaking nginx.conf as well) listen = 127.0.0.1:9000 ; listen = /tmp/php-fpm.sock ; php_admin_value[session.save_path] = /usr/share/php/var/session
3. 啓動fpmphp-fpm
sudo php-fpm
參考:http://verysimple.com/2012/12/06/install-php-fpm-on-osx-10-8-mountain-lion/ui
PS:安裝php的時候若是出現:this
Sorry, the page you are looking for is currently unavailable.
Please try again later.blog
If you are the system administrator of this resource then you should check theerror log for details.get
Faithfully yours, nginx.it
是由於php-fpm服務的問題。