MacOS install configure php-fpm

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

An error occurred.

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服务的问题。

相关文章
相关标签/搜索