Skip to content

Instantly share code, notes, and snippets.

@koriym
Last active March 5, 2019 07:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koriym/4becf500d1b71950668f to your computer and use it in GitHub Desktop.
Save koriym/4becf500d1b71950668f to your computer and use it in GitHub Desktop.

OSX PHP環境構築メモ

PHP 7.x

https://php-osx.liip.ch

curl -s http://php-osx.liip.ch/install.sh | bash -s 7.x

7.xを目的のバージョンに

brew

https://brew.sh/index_ja

brewでインストールしたapacheの設定

https://qiita.com/koriym/items/70be52de20c5895f9620

MySQL 5.7

http://dev.mysql.com/downloads/mysql/ からDMGインストール

/usr/local/mysql/bin/mysqladmin -u root password -p // インストール時に表示されたパスワードを入力、パスワードなしを二回入力
sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf // my.conf作成

my.confに追加

[mysqld]
character-set-server = utf8
default_password_lifetime = 0 

パスワードなし接続で文字コード確認

mysql -u root
show variables like 'char%';
+--------------------------+--------------------------------------------------------+
| Variable_name            | Value                                                  |
+--------------------------+--------------------------------------------------------+
| character_set_client     | utf8                                                   |
| character_set_connection | utf8                                                   |
| character_set_database   | utf8                                                   |
| character_set_filesystem | binary                                                 |
| character_set_results    | utf8                                                   |
| character_set_server     | utf8                                                   |
| character_set_system     | utf8                                                   |
| character_sets_dir       | /usr/local/mysql-5.7.10-osx10.9-x86_64/share/charsets/ |
+--------------------------+--------------------------------------------------------+
8 rows in set (0.00 sec)

Composer

https://getcomposer.org/download/

Global QA tools

composer global require hirak/prestissimo
composer global require bear/qatools

~/.bash_profile

export PATH="/usr/local/php5/bin:$PATH"
export PATH="/usr/local/mysql/bin:$PATH"
export PATH="$HOME/.composer/vendor/bin:$PATH"
alias phpx="php -dzend_extension=xdebug.so"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment