PHP5.3.3源代码编译安装(Linux CentOS 5.5)

来源:互联网 发布:淘宝衣服的宣传海报 编辑:程序博客网 时间:2024/06/07 08:35

PHP5.3.3源代码编译安装(Linux CentOS 5.5)

01#1. install libs needed
02yum -y install libevent libevent-devel
03yum -y install libxml2 libxml2-devel
04yum -y install libmcrypt libmcrypt-devel
05yum -y install curl-devel
06yum -y install libpng-devel
07yum -y install libtool-ltdl-devel
08 
09#2. create user and group for fpm(fastcgi process manager)
10groupadd fpm
11useradd --shell /sbin/nologin -g fpm fpm
12 
13#3. download, configure and install php5.3.3
14wget http://www.php.net/distributions/php-5.3.3.tar.gz
15tar zxvf php-5.3.3.tar.gz
16cd php-5.3.3
17 
18./configure --prefix=/usr/local/php \
19            --enable-fpm \
20            --with-fpm-user=fpm \
21            --with-fpm-group=fpm \
22            --with-mysql=mysqlnd \
23            --with-mysqli=mysqlnd \
24            --with-pdo-mysql=mysqlnd \
25            --without-pdo-sqlite \
26            --without-sqlite3 \
27            --without-sqlite \
28            --with-mysql-sock=/tmp/mysql.sock \
29            --with-curl \
30            --enable-mbstring \
31            --with-mhash \
32            --with-mcrypt \
33            --with-openssl \
34            --with-gd \
35            --enable-sockets \
36            --with-gettext \
37            --with-zlib \
38            --enable-zip \
39            --enable-soap \
40            --with-xmlrpc
41 
42make && make install
43 
44#4. install apc
45#5. install memcached

编译安装PHP5.3.3过程中出现的错误,及解决办法。

1错误: configure: error: libevent >= 1.4.11 could not be found
2解决: yum -y install libevent libevent-devel
1错误: configure: error: xml2-config not found. Please check your libxml2 installation.
2解决: yum -y install libxml2 libxml2-devel
1错误: configure: error: mcrypt.h not found. Please reinstall libmcrypt.
2解决: yum install libmcrypt libmcrypt-devel
1错误: configure: error: Please reinstall the libcurl distribution -
2      easy.h should be in <curl-dir>/include/curl/
3解决: yum -y install curl-devel
4</curl-dir>
1错误: If configure fails try --with-jpeg-dir=
2      configure: error: libpng.(a|so) not found.
3解决: yum -y install libpng-devel
1错误: /usr/bin/ld: cannot find -lltdl
2      collect2: ld returned 1 exit status
3解决: yum -y install libtool-ltdl-devel
原创粉丝点击