当前位置:Gxlcms > PHP教程 > MacLion10.7.2用MacPorts装配Nginx+PHP-FPM

MacLion10.7.2用MacPorts装配Nginx+PHP-FPM

时间:2021-07-01 10:21:17 帮助过:7人阅读

Mac Lion 10.7.2 用MacPorts安装 Nginx + PHP-FPM

Mac Lion 10.7.2 用MacPorts安装 Nginx + PHP-FPM

?

sudo port -v selfupdate

?

?

修改PHP5的Portfile文件

?

sudo vi /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/lang/php5/Portfile

?

?

找到 configure.args?加入一行:–enable-fpm
找到 xinstall …….php-cgi 注释掉

?

?

sudo port install nginx php5 +fastcgi php5-apc php5-mysql +mysqlnd

?

?

修改nginx配置文件

?

sudo cp /opt/local/etc/nginx/nginx.conf.example /opt/local/etc/nginx/nginx.conf sudo vi /opt/local/etc/nginx/nginx.conf

?

?

修改php-fpm配置文件

?

sudo cp /opt/local/etc/php-fpm.conf.default /opt/local/etc/php-fpm.conf sudo vi /opt/local/etc/php-fpm.conf # 查找并编辑以下内容pid = run/php-fpm.pid error_log = log/php-fpm.log listen = /tmp/php-fpm.sock

?

?

修改php配置文件

sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.inisudo vi /opt/local/etc/php5/php.ini

?

?

安装相关的extension

?

sudo port install php5-extension

?

测试nginx配置文件

sudo nginx -t

?

其它相关命令

# 启动nginxsudo nginx# 重启sudo -s reload# 关闭sudo -s stop# 测试php-fpm配置文件sudo php-fpm -t# 启动sudo php-fpm# 立刻关闭 (INT, TERM)sudo kill -INT `cat /opt/local/var/run/php-fpm.pid`# 平滑终止 (QUIT)sudo kill -QUIT `cat /opt/local/var/run/php-fpm.pid`# 重启 (USR1, USR2)sudo kill -USR2 `cat /opt/local/var/run/php-fpm.pid`

??

人气教程排行