Building Development Environment with php-build and phpenv
-
Upload
yuya-takeyama -
Category
Technology
-
view
5.713 -
download
2
description
Transcript of Building Development Environment with php-build and phpenv
![Page 1: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/1.jpg)
Buildin!
Development
Environment with
php-build and phpenv
![Page 2: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/2.jpg)
Self Introduction•@yuya_takeyama
•Interested in...
•Node.js
•Socket.IO
![Page 3: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/3.jpg)
対象者
•色んなバージョンでテストしたい人•最新の文法・機能を試してみたい人•PHP バイナリを集めている人
![Page 4: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/4.jpg)
そんなあなたに
![Page 5: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/5.jpg)
php-build
![Page 6: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/6.jpg)
phpenv
![Page 7: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/7.jpg)
ご紹介
![Page 8: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/8.jpg)
この発表の目的
•もっと色んな人に知って欲しい•いろんな人に使って欲しい•まだまだこなれていない•改善しましょう
![Page 9: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/9.jpg)
php-build
•ソースの取得/ビルドの自動化•定義ファイルに従ってビルド
![Page 10: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/10.jpg)
phpenv
•複数の環境を自由に切り替え•PHP 製のツールも切り替わる •ほとんど rbenv
![Page 11: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/11.jpg)
php-build
![Page 12: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/12.jpg)
インストール
• https://github.com/CHH/php-build
• http://blog.yuyat.jp/archives/1376
•$ git clone して $PATH を追加
![Page 13: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/13.jpg)
定義ファイルの確認$ php-build --definitions5.3.65.3.85.3snapshot5.4.0alpha35.4.0beta15.4.0beta25.4snapshot
![Page 14: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/14.jpg)
ビルド
例)$ php-build 5.3.8 ./php/5.3.8
![Page 15: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/15.jpg)
失敗したら
•ログを確認する$ less ~/.php-build/tmp/php-build.~~~.error.log
•必要なパッケージを適宜追加
![Page 16: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/16.jpg)
Ubuntuの場合
![Page 17: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/17.jpg)
$ sudo aptitude install build-essential bison re2c libxml2-dev zlib1g-dev libcurl4-openssl-dev libjpeg62-dev libpng12-dev libfreetype6-dev libt1-dev libmcrypt-dev libreadline-dev libtidy-dev libxslt1-dev
過不足あったらすいません...
![Page 18: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/18.jpg)
phpenv
![Page 19: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/19.jpg)
インストール
• https://github.com/CHH/phpenv
• http://blog.yuyat.jp/archives/1446
•インストールスクリプト実行して $PATH を追加
![Page 20: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/20.jpg)
使い方•ほとんど rbenv なので
•だいたいここに書いてあるhttps://github.com/sstephenson/rbenv
![Page 21: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/21.jpg)
管理対象の PHP
•~/.phpenv/versions•サブディレクトリがひとつのバージョンに対応
![Page 22: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/22.jpg)
ビルドは php-build で
例)$ php-build 5.4.0beta2 ~/.phpenv/versions/5.4.0beta2
![Page 23: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/23.jpg)
rbenv-install for phpenv
•https://gist.github.com/1305922
$ phpenv install 5.4.0beta2
![Page 24: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/24.jpg)
$ phpenv versions
•利用できるバージョンの確認
![Page 25: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/25.jpg)
$ phpenv global
•利用するバージョンの切り替え•~/.phpenv/version
![Page 26: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/26.jpg)
$ phpenv version
•現在のバージョンの確認
![Page 27: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/27.jpg)
$ phpenv local
•カレントディレクトリ内で利用するバージョンの切り替え
•./.rbenv-version
![Page 28: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/28.jpg)
プラグイン•今朝方知った機能•./.phpenv/plugins/ のサブディレクトリがサブコマンドに
•もちろん元は rbenv の機能
![Page 29: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/29.jpg)
rbenv-each• https://github.com/chriseppstein/rbenv-each
•インストールされた全てのバイナリでコマンドを実行
•$ phpenv each -v php -v
![Page 30: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/30.jpg)
![Page 31: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/31.jpg)
まとめ
•どんどん使いましょう•要望出しましょう•改善しましょう
![Page 32: Building Development Environment with php-build and phpenv](https://reader034.fdocuments.us/reader034/viewer/2022042606/540bf8738d7f726a208b47d0/html5/thumbnails/32.jpg)
ご清聴ありがとうございました