- 2009-09-22 (火) 21:41
- 記事
OSX Server 10.5 (64bit)でPHP+GDを参考にして、PHPをmake。libpng, libjpeg, freetype は fink でインストールしたものを利用した。
# LIBS="-lresolv -L/usr/pkg/lib" ./configure --prefix=/usr/local/ --with-apxs2=/usr/sbin/apxs --enable-cli --with-libxml-dir=/usr --with-openssl=/usr --with-zlib=/usr --with-bz2=/usr --enable-exif --enable-mbstring --enable-mbregex --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-snmp=/usr --with-xmlrpc --with-xsl=/usr --with-gd=/sw --enable-gd-native-ttf --enable-gd-jis-conv --with-jpeg-dir=/sw --with-png-dir=/sw -with-iconv=shared,/usr
# time make -j2
Undefined symbols:
"_res_nclose", referenced from:
_zif_dns_get_record in dns.o
_zif_dns_get_record in dns.o
_zif_dns_get_record in dns.o
"_res_nmkquery", referenced from:
_zif_dns_get_record in dns.o
"_res_ninit", referenced from:
_zif_dns_get_record in dns.o
"_res_nsend", referenced from:
_zif_dns_get_record in dns.o
DNS まわりのエラーが出てしまうようだ。
darwinportのphp5を参考に、main/php_config.h から以下の箇所(計6箇所)をコメントアウト
#define HAVE_RES_NMKQUERY 1
#define HAVE_RES_NSEND 1
今度はiconvまわりでひっかかったので、Leopard に PHP5.2.6 をインストールするを見て configure のオプションを –with-iconv=shared,/usr
としてiconv問題を回避
Build complete.
Don't forget to run 'make test'.
real 32m56.261s
user 18m31.758s
sys 5m56.835s
やっと完成。念のために make test もかけておく。数時間待ちの結果、若干エラーは出たものの、みたところ微妙な箇所なので気にしないことにする。
# make test
=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
output buffering - fatalism [tests/output/ob_011.phpt]
Inconsistencies when accessing protected members [Zend/tests/access_modifiers_008.phpt]
Inconsistencies when accessing protected members - 2 [Zend/tests/access_modifiers_009.phpt]
SimpleXML: array casting bug [ext/simplexml/tests/034.phpt]
=====================================================================
インストールした結果は以下の通り。php.ini が /usr/local/lib という妙な場所に行ってしまったのが嫌な感じだが、configure からやりなおすのは面倒なので放置する。
# make install
Installing PHP SAPI module: apache2handler
/usr/share/httpd/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1/build-1/libtool' libs/libphp5.so /usr/libexec/apache2
/usr/share/apr-1/build-1/libtool --mode=install cp libs/libphp5.so /usr/libexec/apache2/
cp libs/libphp5.so /usr/libexec/apache2/libphp5.so
Warning! dlname not found in /usr/libexec/apache2/libphp5.so.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/libexec/apache2/libphp5.so
[activating module `php5' in /private/etc/apache2/httpd.conf]
Installing PHP CLI binary: /usr/local//bin/
Installing PHP CLI man page: /usr/local//man/man1/
Installing shared extensions: /usr/local//lib/php/extensions/no-debug-non-zts-20090626/
Installing build environment: /usr/local//lib/php/build/
Installing header files: /usr/local//include/php/
Installing helper programs: /usr/local//bin/
program: phpize
program: php-config
Installing man pages: /usr/local//man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local//lib/php/
これで一安心。Apache に指定して phpinfo() を見ると無事動いていた。まだ xcache 等が動いていないので、かなり遅いがひとまず今日はこのへんで終了。
関連記事:
Comments:2
- Sadayuki 09-11-03 (火) 12:42
-
dns.o は下記、
Errors linking libresolv when building PHP 5.2.10 from source on OS X – Stack Overflow – http://bit.ly/dZzaz
iconv.o は下記の記事で行けました。
[PHP] [SOLVED] Re: [PHP] cannot compile PHP 5.2.11 on Mac OS X 10.6.1 – http://bit.ly/2yT0zB - silver 09-11-03 (火) 21:14
-
ありがとうございます。
iconvの方は、一箇所の修正で済むのですこしスマートになりますね。再度作成する事になった時に、試してみます。