Last active
August 29, 2015 14:01
-
-
Save memememomo/feb392426b5f141b31c2 to your computer and use it in GitHub Desktop.
phpenvの導入して複数バージョンのPHPを管理する ref: http://qiita.com/uchiko/items/5f1843d3d848de619fdf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -L https://raw.github.com/CHH/phpenv/master/bin/phpenv-install.sh | bash | |
$ git clone git://github.com/CHH/php-build.git ~/.phpenv/plugins/php-build | |
$ echo 'export PATH="$HOME/.phpenv/bin:$PATH"' >> ~/.bashrc | |
$ echo 'eval "$(phpenv init -)"' >> ~/.bashrc | |
$ exec $SHELL -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ phpenv install -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget https://gist.githubusercontent.com/memememomo/91f774b1e41b24f99e1e/raw/fe57f9936dae16c5ab186919c1611c8f6a4b1fbc/php-build.patch | |
$ patch -u $HOME/.phpenv/plugins/php-build/bin/php-build < php-build.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$HOME/.phpenv/versions/{version}/libexec/libphp5.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo ln -s $HOME/.phpenv/versions/{version}/libexec/libphp5.so /usr/local/apache2/modules/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadModule php5_module modules/libphp5.so | |
AddType application/x-httpd-php .php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo /usr/local/apache2/bin/apachectl restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5.5.1 | |
5.5.10 | |
5.5.11 | |
5.5.12 | |
5.5.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ phpenv install 5.5.12 | |
$ CFLAGS="-g" phpenv install 5.5.12 # コンパイラにオプションを渡す場合 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# デフォルトのオプション | |
$HOME/.phpenv/plugins/php-build/share/php-build/default_configure_options | |
# 各バージョンごとの設定 | |
$HOME/.phpenv/plugins/php-build/share/php-build/definitions/5.5.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# オプションを追加する | |
configure_option "--enable-pcntl" | |
# オプションを外す | |
configure_option -D "--with-mysqli" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ phpenv versions | |
* system (set by /home/uchiko/.phpenv/version) | |
5.5.10 | |
5.5.11 | |
5.5.7 | |
5.5.8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ phpenv global {version} # 全ディレクトリで使うバージョン | |
$ phpenv local {version} # カレントディレクトリのみで使うバージョン(.php-versionが作成される) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configure_option "--with-apxs2" "/usr/local/apache2/bin/apxs" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ which apxs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment