Skip to content

Instantly share code, notes, and snippets.

@ikuwow
Last active May 9, 2016 05:10
Show Gist options
  • Save ikuwow/b38a36e3090cd42646556b4565d89bdd to your computer and use it in GitHub Desktop.
Save ikuwow/b38a36e3090cd42646556b4565d89bdd to your computer and use it in GitHub Desktop.
phpbrew @ Mac で複数バージョンのphpの環境構築するAnsible Playbook ref: http://qiita.com/ikuwow/items/58d5e36913266d441557
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Users/degawaikuo/.phpbrew/php/php-5.6.21/bin/php-config
---
- name: Install taps of php
homebrew_tap: tap=homebrew/php
# phpbrewがはいってる
- name: Remove current php packages
homebrew: name={{item}} state=absent
with_items:
- php56
- composer
- php56-mcrypt
- php56-intl
- php56-pdo-pgsql
# いままでのを削除
- name: Install required packages
homebrew: name={{item}}
with_items:
- phpbrew
- openssl
- libxml2
# この辺りのパッケージを入れておく必要がある
- name: Initlalize phpbrew
shell: "phpbrew init"
args:
creates: ~/.phpbrew
# After initialization you have to append .bashrc `source ~/.phpbrew/bashrc`
- name: Is openssl of homebrew enabled?
shell: "[[ `which openssl` = /usr/local/bin/openssl ]]; echo $?"
register: brew_openssl_enabled
changed_when: brew_openssl_enabled.stdout != '0'
- name: Force link openssl
shell: "brew link --force openssl"
when: brew_openssl_enabled.stdout != '0'
- name: Force link libxml2
shell: "brew link --force libxml2"
args:
creates: /usr/local/include/libxml2
- name: Install php {{base_php_version}}
shell: "phpbrew install {{base_php_version}} +default"
args:
creates: ~/.phpbrew/php/php-{{base_php_version}}
- name: Is php in phpbrew?
shell: "which php | grep phpbrew > /dev/null; echo $?"
register: php_is_in_phpbrew
changed_when: php_is_in_phpbrew.stdout != '0'
- name: Use php in phpbrew
shell: "source ~/.phpbrew/bashrc && phpbrew switch {{base_php_version}}"
when: php_is_in_phpbrew.stdout != '0'
- name: Install composer
shell: "phpbrew app get composer"
args:
creates: "~/.phpbrew/bin/composer"
$ ehco $PATH
/Users/username/.pyenv/shims:/Users/username/.rbenv/shims:/Users/username/.phpbrew/php/php-5.6.21/bin:/Users/username/.phpbrew/bin:/Users/username/bin:/usr/local/heroku/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.
Binaries provided by keg-only formulae may override system binaries
with other strange results.
You may wish to `brew unlink` these brews:
libxml2
openssl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment