![OSX Yosemite のアップグレード後に Apache が起動しない](https://rvso.com/image/1438678/OSX%20Yosemite%20%E3%81%AE%E3%82%A2%E3%83%83%E3%83%97%E3%82%B0%E3%83%AC%E3%83%BC%E3%83%89%E5%BE%8C%E3%81%AB%20Apache%20%E3%81%8C%E8%B5%B7%E5%8B%95%E3%81%97%E3%81%AA%E3%81%84.png)
私は OSX 10.9 に Homebrew を使用して Apache 2.2 をインストールしましたが、今週末に Yosemite にアップグレードするまでは正常に動作していました。
sudo apachectl start
ps aux | grep httpd
ps aux | grep apache
sudo /usr/local/Cellar/httpd22/2.2.27/bin/httpd -k start
それらはすべて何も返しません。
sudo apachectl
戻り値:
Usage: /usr/local/Cellar/httpd22/2.2.27/bin/httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S]
エラーがあるかどうかを確認するにはどのファイルを調べればよいかご存知ですか?MAMP Proにも同様の問題があり、envvarsを_envvarsに名前変更することで修正されるようです。試してみましたが、うまくいきませんでした。
さらに詳しい情報が必要な場合はお知らせください。
答え1
最初にこれをやるべきだったのですが、ようやく確認したところ/usr/local/var/log/apache2/error_log
、次のことがわかりました。
[Tue Jan 27 14:56:07 2015] [error] (2)No such file or directory: could not create /usr/local/var/run/apache2/httpd.pid
[Tue Jan 27 14:56:07 2015] [error] httpd: could not log pid to file /usr/local/var/run/apache2/httpd.pid
明らかにそれが問題でした... フォルダーを作成したら/usr/local/var/run/apache2/
、できました!
答え2
これを試して、
brew update
brew doctor
brew reinstall php53 --with-mysql --with-pgsql --with-apache
sudo apachectl -k restart
ご希望の場合は、完全な投稿をこちらでご覧いただけます:
http://benedmunds.com/php/2014/10/16/fixing-homebrew-php-apache-after-yosemite/