본문 바로가기
Infra & Server Dev

[Mac] 맥에서 nginx, php-fpm 설치하기.

by 필팔청춘 2017. 8. 16.


HomeBrew 설치

https://brew.sh/index_ko.html



Nginx 설치

brew install nginx


nginx 설정 파일 : vi /usr/local/etc/nginx/nginx.conf

실행 : nginx

리로드 : nginx -s reload

정지 : nginx -s stop



php-fpm 설치

brew tap homebrew/dupes 

brew tap josegonzalez/homebrew-php


brew install --without-apache --with-fpm --with-mysql php56


자동실행 디렉토리... LaunchAgents  이미 만들어져있으면 mkdir은 안해도됨.

mkdir -p ~/Library/LaunchAgents 


cp /usr/local/opt/php56/homebrew.mxcl.php56.plist 

~/Library/LaunchAgents/ 


PHP-FPM 실행

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist


실행여부 체크

lsof -Pni4 | grep LISTEN | grep php



참고1 : http://www.hides.kr/608

참고2 : http://lhb0517.tistory.com/entry/OS-X-%EB%A7%A5-OS-X-%EB%A7%A5%EC%97%90%EC%84%9C-nginx-%EC%9B%B9%EC%84%9C%EB%B2%84-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0

참고3 : http://devspark.tistory.com/entry/mac-%EC%97%90%EC%84%9C-nginx-%EC%84%A4%EC%B9%98-%EB%B0%8F-%EC%84%A4%EC%A0%95-%ED%95%98%EA%B8%B0

참고4 : https://blog.frd.mn/install-nginx-php-fpm-mysql-and-phpmyadmin-on-os-x-mavericks-using-homebrew/









brew tap homebrew/dupes 

brew tap josegonzalez/homebrew-php


출처http://www.hides.kr/608 [Hide]


brew install --without-apache --with-fpm --with-mysql php56



launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist 

ps -ef|grep php

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist 

ps -ef|grep php