LoginSignup
13
13

More than 5 years have passed since last update.

PHP開発環境構築メモ

Last updated at Posted at 2014-04-24

Mountain LionにPHPの環境を構築したのでメモしておきます。

Homebrew

インストール
ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
確認
brew doctor
/usr/local/sbinの作成
mkdir /usr/local/sbin
pathの設定
export PATH=/usr/local/sbin:$PATH
export PATH=/usr/local/bin:$PATH

Apacheのインストール

Formulaの登録
brew tap Homebrew/dupes
インストール
brew install httpd
起動
sudo /usr/local/sbin/apachectl start
sudo /usr/local/sbin/apachectl stop

MySQLのインストール

インストール
brew install mysql
MySQLの初期化
mysql_install_db --verbose -user=$(whoami) --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
MySQLの起動
cd /usr/local/opt/mysql
/usr/local/opt/mysql/bin/mysqld_safe &
初期設定
/usr/local/opt/mysql/bin/mysql_secure_installation
確認
mysql -u root -p
起動
/usr/local/bin/mysql.server start 
/usr/local/bin/mysql.server stop 

memcachedのインストール

brew install memcached

PHPのインストール

Formulaの登録
brew tap josegonzalez/php
インストール
brew install php53 --with-mysql --with-pgsql --with-apache --with-intl --with-readline
パスの設定
PATH="$(brew --prefix josegonzalez/php/php53)/bin:$PATH"
xdebugのインストール
brew install php53-xdebug
その他モジュールのインストール
brew install php53-memcache
brew install php53-imagick
phpunitのインストール
pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit

参考URL

13
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13