「Mac/インストール/php-fpm」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→Operation not permittedエラー) |
(→自動起動) |
||
行20: | 行20: | ||
==自動起動== | ==自動起動== | ||
ln -s /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/homebrew.mxcl.php56.plist | ln -s /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/homebrew.mxcl.php56.plist | ||
+ | launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php56.plist | ||
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php56.plist | launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php56.plist | ||
2016年12月27日 (火) 21:29時点における版
目次
php-fpmインストール
$ brew update $ brew tap homebrew/dupes $ brew tap homebrew/versions $ brew tap homebrew/php $ brew install homebrew/php/php56 --with-fpm
php-fpm設定
$ sudo cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf $ sudo vi /private/etc/php-fpm.conf ;pid = run/php-fpm.pid pid = /var/run/php-fpm.pid ;error_log = log/php-fpm/php-fpm.log error_log = /var/log/php-fpm/php-fpm.log $ sudo mkdir /var/log/php-fpm $ sudo php-fpm
参考:http://qiita.com/alegriaghost/items/7af4bf029e90ec37f7e0
自動起動
ln -s /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/homebrew.mxcl.php56.plist launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php56.plist launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
Operation not permittedエラー
error_logを変更せずにphp-fpmを起動しようとするとエラーとなる
Error: Failed to download resource "libpng"
Homebrewの権限を確認
ls -ltA /Users/mac1/Library/Caches/Homebrew
起動
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
停止
$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist