10/23/2009 centos 5.3
jpeg6
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
# make
# mkdir /usr/local/jpeg6
# mkdir /usr/local/jpeg6/bin
# mkdir /usr/local/jpeg6/lib
# mkdir /usr/local/jpeg6/include
# mkdir /usr/local/jpeg6/man
# mkdir /usr/local/jpeg6/man1
# mkdir /usr/local/jpeg6/man/man1
# make install
libpng
# tar zxf libpng-1.2.40.tar.gz
# cd libpng-1.2.40
# ./configure --prefix=/usr/local/libpng
# make
# make install
freetype
# tar zxf freetype-2.3.11.tar.gz
# cd freetype-2.3.11
# ./configure --prefix=/usr/local/freetype
# make
# make install
zlib
# tar zxf zlib-1.2.3.tar.gz
# cd zlib-1.2.3
# ./configure --prefix=/usr/local/zlib
# make
# make install
libxml2
# tar zxf libxml2-2.7.2.tar.gz
# cd libxml2-2.7.2
# ./configure --prefix=/usr/local/libxml2
# make
# make install
fontconfig
# tar zxf fontconfig-2.7.3.tar.gz
# cd fontconfig-2.7.3
# ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config
#
出现
checking for LIBXML2... configure: error: Package requirements (libxml-2.0 >= 2.6) were not met:
No package 'libxml-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBXML2_CFLAGS
and LIBXML2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
如下操作
#export PKG_CONFIG_PATH=/usr/local/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH
再继续
# ./configure --prefix=/usr/local/fontconfig --with-freetype-config=/usr/local/freetype/bin/freetype-config --enable-libxml2
# make
# make install
libmcrypt
# tar zxf libmcrypt-2.5.7.tar.gz
# cd libmcrypt-2.5.7
# ./configure
# make
# make install
gd
# tar zxf gd-2.0.36RC1.tar.gz
# cd gd-2.0.36RC1
# ./configure --prefix=/usr/local/libgd --with-jpeg=/usr/local/jpeg6 --with-zlib-dir=/usr/local/zlib --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/fontconfig
# make
# make install
curl
# tar zxf curl-7.19.6.tar.gz
# cd curl-7.19.6
# ./configure --prefix=/usr/local/curl
# make
# make install
libxslt
# tar zxf libxslt-1.1.22.tar.gz
# cd libxslt-1.1.22
# ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
# make
# make install
php5
# tar zxf php-5.2.11.tar.gz
# cd php-5.2.11
# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/lib/mysql --with-gd=/usr/local/libgd --enable-gd-native-ttf --with-jpeg-dir=/usr/local/jpeg6 --with-zlib-dir=/usr/local/zlib --with-png-dir=/usr/local/libpng --with-freetype-dir=/usr/local/freetype --enable-mbstring=all --with-curl=/usr/local/curl --enable-mbregex --with-config-file-path=/usr/local/php5 --enable-ftp --enable-soap --with-xsl=/usr/local/libxslt --enable-gd-jis-conv -with-libxml-dir=/usr/local/libxml2 --enable-xml --enable-sockets
# make
# make test
# make install
出现
Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line
这样之后可以解决
mv /usr/local/lib/php/.channels /usr/local/lib/php/.channels-old
/usr/local/php/bin/pecl update-channels
装完了 出现如下信息
Wrote PEAR system config file at: /usr/local/php5/etc/pear.conf
You may want to add: /usr/local/php5/lib/php to your php.ini include_path
Installing PDO headers: /usr/local/php5/include/php/ext/pdo/
# cp php.ini-dist /usr/local/php5/lib/php/php.ini
# vi /usr/local/apache/conf/httpd.conf
加入
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
重启Apache出现
# httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
# vi /etc/selinux/config
注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
重启系统 就好了
装ZendOptimizer
# tar zxfv ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz
# cd ZendOptimizer-3.3.9-linux-glibc23-i386
# cp data/5_2_x_comp/ZendOptimizer.so /usr/lib
vi /usr/local/php5/lib/php/php.ini
zend_extension=/usr/lib/ZendOptimizer.so
没有效果,ZendOptimizer没装成
看了phpinfo之后
# mv /usr/local/php5/lib/php/php.ini /usr/local/php5/php.ini
才行,原来php.ini应该放在/usr/local/php5/php.ini这个位置。
-----------091106--后续------
未支持msqli
编译时加上--with-mysqli=/usr/local/bin/mysql_config
错误,configure: error: wrong mysql library version or lib not found. Check config.log for more information.
之前也见过滴
# cd /usr/local/src/php/php-5.2.11/ext/mysqli
# /usr/local/php5/bin/phpize
# ./configure --prefix=/usr/local/lib/mysql/ --with-php-config=/usr/local/php5/bin/php-config --with-mysqli=/usr/local/bin/mysql_config
# make
# make test
# make install
然后出现Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/
# vi vi /usr/local/php5/php.ini
加入
extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/mysqli.so
应用过程中
Warning: Cannot modify header information - headers already sent by
后来打开 php.ini 然后把 output_buffering 设为 on 。重起appache,OK。