遺憾ながらphp。WordPressとかはすきなんだけど。
betaとかつけるのがめんどくさい場合はとか。
依存モジュールをインストールしたい場合は--alldepsをつけるとよい。--onlyreqdeps でもいけそうだけど。
phpbrewで設定する。システム自体にphp5.3以上がインストールされていないといけない。
とりあえず必要そうなものをインストールする
yum install libxml2-devel libxml2 libicu libicu-devel libxslt libxslt-devel yum install php-cli php-common php-xml yum install --enablerepo=rpmforge re2c libmhash
インストーラは無いようだ。一般アカウントでHOMEにインストールする
その後は書いている通り
# ~/binにPATH通しといたほうがいいでしょう mkdir ~/bin cd bin curl -O https://raw.github.com/c9s/phpbrew/master/phpbrew chmod +x phpbrew
その後は書いている通り
cd phpbrew init cat <<EOL>> ~/.bashrc # for phpbrew if [ -f /home/holly/.phpbrew/bashrc ]; then export PHPBREW_SET_PROMPT=1 source /home/holly/.phpbrew/bashrc fi EOL
known, variantsを覚えておけばよさそう。
variants
brew your latest php! Available options: -v, --verbose Print verbose message. -d, --debug Print debug message. -q, --quiet Be quiet. -h, --help help --version show version Available commands: help - show help message. init - initialize phpbrew config file. known - list known PHP versions install - install php list - list installed PHP versions use - use php, switch version temporarily switch - switch default php version. info - show current php information env - export environment variables variants - list php variants config - your awesome brief. enable - enable extension install-ext - install extension for current PHP. self-update - self-update, default to master version
variants
Variants default dbs dba ipv6 all calendar posix embed readline pdo gd openssl mysql fpm sqlite pgsql cli ftp filter gcov sockets apxs2 debug zip bcmath fileinfo ctype cgi soap pcntl intl imap tidy kerberos iconv bz2 ipc Variant sets default: pdo, posix, calendar, bz2, cli, readline, sockets, fpm dbs: pdo, mysql, pgsql, sqlite Example: phpbrew install php-5.3.10 +default phpbrew install php-5.3.10 +mysql +pdo phpbrew install php-5.3.10 +mysql +pdo +apxs2 phpbrew install php-5.3.10 +mysql +pdo +apxs2=/usr/bin/apxs2
php-fpmは明示的に指定する
完了後は以下を実行する
phpbrew -d install php-5.4.7 +default +intl +pcntl +filter +sqlite -- --enable-fpm
完了後は以下を実行する
phpbrew use php-5.4.7
インストールすると $PHPBREW_HOME/php/$PHPBREW_PHP/lib/php/extensions/no-debug-non-zts-20100525/にインストールされる
あとで気づいたことだけど↓でインストールできる
cd $PHPBREW_HOME/php/$PHPBREW_PHP/ext
あとで気づいたことだけど↓でインストールできる
phpbrew install-ext $extension
cd curl sudo yum install libcurl-devel phpize ./configure make make test make install echo "extension = curl.so" > $PHPBREW_HOME/php/$PHPBREW_PHP/var/db/curl.ini
これもどういう設定がbestなのかよくわからない。そもそも言語に設定ファイルあるとかが気持ち悪い。phpbrewでインストールすると$PHPBREW_HOME/php/$PHPBREW_PHP/etc/php.iniとなるが、直接編集せず--with-config-file-scan-dirで指定されたディレクトリに個別のphp.iniの設定を設置する。$PHPBREW_HOME/php/$PHPBREW_PHP/var/dbとなる
mkdir $PHPBREW_HOME/php/$PHPBREW_PHP/var/db cat <<EOL >$PHPBREW_HOME/php/$PHPBREW_PHP/var/db/datetime.ini date.timezone = Asia/Tokyo EOL
mbstring系はここが詳しい。基本方針としては説明だけは書いてるけど頼らないのが一番。
name | description |
---|---|
date.timezone | 設定しないとdate系の関数が使えない?Asia/Tokyoと指定しておく |
default_charset | 出力時にHTTPヘッダとして送信する文字コード名。webに限るものじゃないので設定はしない。明示的にContent-typeのcharsetが必要な場合は指定する |
mbstring.language | mb_send_mailで使われるくらい。そもそも使わない関数なので設定しない |
mbstring.internal_encoding | mbstring関数のデフォルトエンコード。別に設定する必要はない |
mbstring.http_input | 入力データの文字コード。いらない |
mbstring.encoding_translation | 入力データの文字コード自動変換。off or 設定しない |
mbstring.http_output | mb_output_handlerが実行された時の出力エンコード。いらない |
mbstring.detect_order | 自動文字コード判定。autoはあれなので使わない。必要なら明示的に判定すること |
mbstring.substitute_character | 無効な文字を代替する文字を定義する。いらん |
pyrusを使うので、おそらく直接つかうことはないと思うけど。
Commands: build Build an Extension From C Source bundle Unpacks a Pecl Package channel-add Add a Channel channel-alias Specify an alias to a channel name channel-delete Remove a Channel From the List channel-discover Initialize a Channel from its server channel-info Retrieve Information on a Channel channel-login Connects and authenticates to remote channel server channel-logout Logs out from the remote channel server channel-update Update an Existing Channel clear-cache Clear Web Services Cache config-create Create a Default configuration file config-get Show One Setting config-help Show Information About Setting config-set Change Setting config-show Show All Settings convert Convert a package.xml 1.0 to package.xml 2.0 format cvsdiff Run a "cvs diff" for all files in a package cvstag Set CVS Release Tag download Download Package download-all Downloads each available package from the default channel info Display information about a package install Install Package list List Installed Packages In The Default Channel list-all List All Packages list-channels List Available Channels list-files List Files In Installed Package list-upgrades List Available Upgrades login Connects and authenticates to remote server [Deprecated in favor of channel-login] logout Logs out from the remote server [Deprecated in favor of channel-logout] makerpm Builds an RPM spec file from a PEAR package package Build Package package-dependencies Show package dependencies package-validate Validate Package Consistency pickle Build PECL Package remote-info Information About Remote Packages remote-list List Remote Packages run-scripts Run Post-Install Scripts bundled with a package run-tests Run Regression Tests search Search remote package database shell-test Shell Script Test sign Sign a package distribution file svntag Set SVN Release Tag uninstall Un-install Package update-channels Update the Channel List upgrade Upgrade Package upgrade-all Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters] Usage: pear [options] command [command-options] <parameters> Type "pear help options" to list all options. Type "pear help shortcuts" to list all command shortcuts. Type "pear help <command>" to get the help for the specified command.
channel一覧
pear list-channels Registered Channels: ==================== Channel Alias Summary doc.php.net phpdocs PHP Documentation Team pear.php.net pear PHP Extension and Application Repository pecl.php.net pecl PHP Extension Community Library __uri __uri Pseudo-channel for static packages
pear install pear/HTTP2ただしstableしかインストールできない仕組みになっているため、betaやalpha版しかリリースされていないようなパッケージの場合は
# versionでもよい。pear/HTTP2-0.1.0とか pear install pear/HTTP2-betaのようにする。↓は安定している順番
- stable
- beta
- alpha
- devel
betaとかつけるのがめんどくさい場合はとか。
pear config-set preferred_state beta
依存モジュールをインストールしたい場合は--alldepsをつけるとよい。--onlyreqdeps でもいけそうだけど。
pear install --alldeps pear/HTTP2
置き場所はどこでもよい
aliasでもいい。.bash_profileとか.bashrcとかに設定しておくとよい
cd $PHPBREW_PATH curl -LO http://pear2.php.net/pyrus.phar cat <<EOL >pyrus #!/bin/sh env php \$PHPBREW_PATH/pyrus.phar \$@ EOL chmod +x pyrus
aliasでもいい。.bash_profileとか.bashrcとかに設定しておくとよい
alias pyrus="env php $PHPBREW_PATH/pyrus.phar"
基本的にはプロジェクトごとにライブラリをインストールしたいので。前準備として以下のようにしておく
このなかに個別にディレクトリを切ってライブラリを追加する
あとはこの中に移動して以下のような感じで。PHPUnitをインストールする場合
mkdir ~/pyrus-sandbox
このなかに個別にディレクトリを切ってライブラリを追加する
mkdir ~/pyrus-sandbox/foo
あとはこの中に移動して以下のような感じで。PHPUnitをインストールする場合
cd ~/pyrus-sandbox/foo pyrus $PWD set bin_dir $PWD/bin pyrus $PWD set auto_discover on pyrus $PWD channel-discover pear.phpunit.de pyrus $PWD install phpunit/PHPUnit
searchは出来るけど、インストールはどうやらこける。対象プロジェクトにインストールしたい場合は自分で取得するしかない?。APCの場合は
cd ~/pyrus-sandbox/foo curl -LO http://pecl.php.net/get/APC-3.1.13.tgz tar xvfz APC-3.1.13.tgz cd APC-3.1.13 phpize ./configure make export TEST_PHP_ARGS='-n' make test make install EXTENSION_DIR=/path/to/aa(あとで直す)
タグ
最新コメント