PHP5.3.3源代码编译安装(Linux CentOS 5.5)
01 | #1. install libs needed |
02 | yum -y install libevent libevent-devel |
03 | yum -y install libxml2 libxml2-devel |
04 | yum -y install libmcrypt libmcrypt-devel |
05 | yum -y install curl-devel |
06 | yum -y install libpng-devel |
07 | yum -y install libtool-ltdl-devel |
09 | #2. create user and group for fpm(fastcgi process manager) |
11 | useradd --shell /sbin/nologin -g fpm fpm |
13 | #3. download, configure and install php5.3.3 |
15 | tar zxvf php-5.3.3.tar.gz |
18 | ./configure --prefix=/usr/local/php \ |
21 | --with-fpm-group=fpm \ |
22 | --with-mysql=mysqlnd \ |
23 | --with-mysqli=mysqlnd \ |
24 | --with-pdo-mysql=mysqlnd \ |
25 | --without-pdo-sqlite \ |
28 | --with-mysql-sock=/tmp/mysql.sock \ |
编译安装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 |
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 |