MySQLとPearのインストール (MacOS10.5)

$ port variants php5
$ sudo port -d install php5 +mysql5 +pear

確認

$ php -i | grep Configure
Configure Command => './configure' '--prefix=/opt/local' '--mandir=/opt/local/share/man' '--infodir=/opt/local/share/info' '--with-config-file-path=/opt/local/etc/php5' '--with-config-file-scan-dir=/opt/local/var/db/php5' '--disable-all' '--enable-bcmath' '--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-hash' '--enable-json' '--enable-libxml' '--enable-pdo' '--enable-phar' '--enable-session' '--enable-simplexml' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-bz2=/opt/local' '--with-mhash=/opt/local' '--with-pcre-regex=/opt/local' '--with-readline=/opt/local' '--with-libxml-dir=/opt/local' '--with-zlib=/opt/local' '--disable-cgi' '--with-ldap=/usr' '--with-apxs2=/opt/local/apache2/bin/apxs' '--with-pear=/opt/local/lib/php'

pythonより、lxmlのインストール (MacOS10.5)

lxmlを入れるには、libxml2、libxsltのインストールは必須である。
libxml2、libxsltが入っているかの確認は、

$ sudo port installed


$ sudo port install libxml2
$ sudo port install libxslt
$ sudo easy_install lxml

もしエラーが出たら:http://d.hatena.ne.jp/dai_yamashita/20090326/1238020071

pythonインストール後にはeasy_installのインストール (MacOS10.5)

# ez_setup.pyをダウンロード

$ curl http://peak.telecommunity.com/dist/ez_setup.py -o ez_setup.py

# ez_setup.pyを実行

$ python ez_setup.py

# 既存にあるeasy_installをリネーム

$ sudo mv /usr/bin/easy_install /usr/bin/easy_install.old

# リンクを作成

$ sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/bin/easy_install /usr/bin/easy_install

# 確認

$ ls -la /usr/bin/easy_install
lrwxr-xr-x 1 root wheel 66 7 5 12:28 /usr/bin/easy_install -> /Library/Frameworks/Python.framework/Versions/2.6/bin/easy_install


参考:http://0ya6in.blog.so-net.ne.jp/2009-07-05

MacPortsのインストール (MacOS10.5)

MacPortsのパスを通す

$ export PATH=/opt/local/bin:/opt/local/sbin:$PATH
$ export MANPATH=/opt/local/share/man:/opt/local/man:$MANPATH

パスが通ったか確認

$ sudo port version
Version: 1.8.1

確認できたら、ホームフォルダに移動して、

$ cd

.bash_profile を編集/無ければ新規作成する。いずれにせよ実行するコマンドは同じ。

$ vi .bash_profile

vi が使えるなら

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:/opt/local/man:$MANPATH

を書き足す。上書き保存は「esc」→:wq です。