phpenvで古いphp 5.3.3をOSX 10.10に入れる。
やたら時間取られたよ。こんなことで。
ネックはphp 5.3.3が要求するlibxml2がOSX 10.10では新しすぎるのと、opensslが古すぎる点。
まず古いlibxml2をコンパイルして適当な場所にインストールします
$ mkdir -p $HOME/libxml2-2.7.8/dist $ cd $HOME/libxml2-2.7.8 $ wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz $ tar zxvf libxml2-2.7.8.tar.gz $ cd libxml2-2.7.8 $ ./configure --prefix $HOME/libxml2-2.7.8/dist $ make && make install
opensslを新しくします
$ brew install openssl $ brew link openssl --force $ exec $SHELL -l
コンパイルオプションでlibxml2のディレクトリを指定します
$ /usr/bin/sed -i '' -e '1i\'$'\n'"configure_option -R \"--with-libxml-dir=$HOME/libxml2-2.7.8/dist\"" $HOME/.phpenv/plugins/php-build/share/php-build/definitions/5.3.3
おもむろにインストール
$ phpenv install 5.3.3
なんでか知らんがtmpに残ってるダウンロード済みphpのソースを一旦消すと上手くいったりいかなかったり。php触りたくない。
ヒントはここにあった: http://www.devsumo.com/technotes/2014/06/php-node-lo-compiler-errors-when-building-on-os-x-10-9/













