编译安装 PHP 5.3.4 通过 

前段时间,php 发布了5.3.4版本,修复了在 PHP-FPM SAPI 方面的一些bug,于是便打算跟进了.

先完全卸载掉之前的php 版本,下载最新的5.3.4源码包(http://www.php.net/distributions/php-5.3.4.tar.bz2),解压,进入目录

我的configure:
[[email protected] php-5.3.4]# ./configure \
> --prefix=/usr/local/php \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/php \
> --localstatedir=/var/run \
> --disable-cli \
> --enable-embed=no \
> --enable-fpm \
> --with-fpm-user=http \
> --with-fpm-group=web \
> --with-config-file-path=/etc/php.ini \
> --with-config-file-scan-dir=/etc/sysconfig/php \
> --with-exec-dir=/usr/local/bin \
> --disable-ipv6 \
> --with-openssl \
> --with-kerberos \
> --with-pcre-regex \
> --with-zlib \
> --with-bz2 \
> --enable-calendar \
> --with-curl \
> --with-curlwrappers \
> --enable-dba=shared \
> --enable-exif \
> --enable-ftp \
> --with-gd \
> --enable-gd-native-ttf \
> --with-gettext \
> --with-mhash \
> --with-imap \
> --with-kerberos \
> --with-imap-ssl \
> --enable-intl \
> --with-ldap \
> --enable-mbstring \
> --with-mcrypt \
> --with-mysql=/usr/local/mysql \
> --with-mysql-sock=/tmp/mysql.sock \
> --with-mysqli=/usr/local/bin/mysql_config \
> --enable-soap \
> --enable-sockets \
> --enable-sqlite-utf8 \
> --enable-wddx \
> --with-xmlrpc \
> --with-xsl \
> --enable-zip \
> --enable-zend-multibyte \
> --without-pear

检查依赖。报错了,

checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... /tmp/mysql.sock
configure: error: Cannot find libmysqlclient under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!


是mysql 安装目录不完整的问题,解决方案:
1.进入mysql 安装根目录
2.ln -s /usr/local/lib lib

make distclean ,再次检查依赖,通过了。

接下来,make 编译,时间会比较长。耐心等待……
编译完成后,make install 安装即可.


[[email protected] php-5.3.4]# make install
Installing PHP SAPI module: fpm
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
Installing PHP FPM binary: /usr/local/sbin/
Installing PHP FPM config: /etc/sysconfig/php/
Installing PHP FPM man page: /usr/local/php/man/man8/
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/php/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php/man/man1/
page: phpize.1
page: php-config.1
Installing PDO headers: /usr/local/php/include/php/ext/pdo/


测试下php,

[[email protected] php-5.3.4]# php-fpm -v
PHP 5.3.4 (fpm-fcgi) (built: Dec 17 2010 09:23:44)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

一切正常。再把之前备份的配置文件放到 /etc/sysconfig/php 下,启动php-fpm 就OK了.

至此,php 升级安装完成.
[ ] ( 1731 次浏览 ) 永久链接 ( 3 / 1734 )

<< <上一页 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 下一页> >>