Solaris 10下安装apache2.2.8和PHP5.2.6的问题
首先已经从 www.sunfreeware.com 下载了需要的扩展包,我只想编译apache和php。
编译apache,使用如下配置参数:
./configure --prefix=/usr/apache2.2 --with-mpm=worker --enable-so --enable-mods-shared=all --enable-modules=all --enable-ssl=shared --enable-ssl --with-ssl=/usr/local/ssl --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer
顺利通过。
编译PHP使用如下参数:
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/apache2.2/bin/apxs \
--with-mysql=/usr/mysql/mysql5 \
--with-curl=/usr/local \
--enable-ftp \
--with-libxml-dir=/usr/local \
--enable-soap \
--with-xsl=/usr/local \
--with-zlib-dir=/usr/local \
--with-freetype-dir=/usr/local \
--enable-mbstring \
--enable-sockets \
--with-ldap=/usr/local \
--enable-exif \
--with-gd=/usr/local \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-mcrypt=/usr/local/libmcrypt
注意,libmcrypt也是编译的,适用如下参数:
./configure --prefix=/usr/local/libmcrypt --disable-posix-threads --enable-dynamic-loading
编译时,你需要设置变量 LD_LIBRARY_PATH。
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
在编译php时,最后出现如下错误:
libtool: link: warning: library `/usr/local/lib/libfreetype.la' was moved.
libtool: link: warning: library `/usr/local/lib/libfreetype.la' was moved.
ld: fatal: library -lnet: not found
ld: fatal: File processing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
研究了半天发现,只有使用 --with-ldap时出现这个问题。
在Google搜索了半天,无具体方法,但是找到了一点提示,哈哈,发现找不到libnet.so,搜索了一下,发现其是java下的库。
通过设置 LD_LIBRARY_PATH=/usr/jdk/instances/jdk1.5.0/jre/lib/i386,再编译问题得到解决!
