php

「php」の編集履歴(バックアップ)一覧に戻る

php - (2012/11/14 (水) 00:18:25) のソース

*MacPortsインストール
----
更新日 2012-11-13
http://www.macports.org/install.php
上のサイトから、pkgファイルをダウンロードすればok

*PHPUnitインストール
----
更新日 2012-11-13
MAMPのバージョン2.0.5
#blockquote(){
cd /Applications/MAMP/bin/php/php5.3.6/bin
sudo ./pear upgrade pear
./pear channel-discover pear.phpunit.de
./pear channel-discover components.ez.no
./pear channel-discover pear.symfony-project.com
sudo ./pear install phpunit/PHPUnit
}
こんなエラーが出たら、
#blockquote(){
Notice: unserialize(): Error at offset 276 of 1133 bytes in Config.php on line 1050
Notice: unserialize(): Error at offset 276 of 1133 bytes in /Applications/MAMP/bin/php/php5.3.6/lib/php/PEAR/Config.php on line 1050
ERROR: The default config file is not a valid config file or is corrupted.
}
以下のコマンドを入力して、pear.confを削除する。
#blockquote(){
rm /Applications/MAMP/bin/php/php5.3.6/conf/pear.conf
}

東工大のネットからpearをupgradeしようとしたら、以下のエラーが出てできなかった。
#blockquote(){Could not get contents of package "/Applications/MAMP/bin/php/php5.3.6/bin/pear". Invalid tgz file.}

sudoをはずすと途中まではできるようになった。ただし、権限がないためにこんなエラーが出る。
#blockquote(){ERROR: failed to mkdir /Applications/MAMP/bin/php/php5.3.6/lib/php/docs/PEAR}

強引ではあるが、Finderから上のディレクトリを作成する。
#image(http://www.teststorage.miraiserver.com/wordpress/wp-content/uploads/2012/10/ae0657b44fc22bbfae2e8690c6fa4b03.png)

次に、sudoをしないでpearをアップグレードさせる。
#blockquote(){./pear upgrade pear}

参考サイト
http://d.hatena.ne.jp/nkimra/20120715/1342312360