- 安装依赖包,其中有部分软件是由EPEL提供,所以要添加EPEL源
- sudo yum install gcc gcc-c++ libxml2 libxml2-devel autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel zlib zlib-devel \
- glibc glibc-devel glib2 glib2-devel openssl-devel bzip2-devel libcurl-devel t1lib-devel gmp-devel libc-client-devel openldap-devel unixODBC-devel \
- mysql-devel expat-devel libxslt-devel libmcrypt libmcrypt-devel libedit wget
- 调整库文件
- ln -sv /usr/lib64/libc-client.so /usr/lib/libc-client.so
- ln -sv /usr/include/sqlext.h /usr/local/include/
- 安装PHP(j坚持最小化原则,只开启需要的功能)
- wget http://cn2.php.net/distributions/php-5.3.28.tar.bz2
地址不可用时可以使用:http://php.net/get/php-5.3.28.tar.gz/from/a/mirror
- tar jxf php-5.3.28.tar.bz2
- cd php-5.3.28
- ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-config-file-scan-dir=/usr/local/php5/etc/php.d --with-bz2 --with-openssl --with-zlib --with-mhash --with-pcre --enable-exif --enable-sockets --enable-mbstring --enable-xml --enable-fpm --enable-soap --with-gd --with-curl --with-mcrypt --with-unixODBC --with-imap --with-imap-ssl --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-mysqli --with-pdo-mysql --enable-dom --with-kerberos --disable-debug
- make
- make install
- 安装后的配置
- cp php.ini-production /usr/local/php5/etc/php.ini
- cp /usr/local/php5/etc/php-fpm.conf.default /usr/local/php5/etc/php-fpm.conf
- mkdir /usr/local/php5/etc/php.d
- cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
- chmod u+x /etc/init.d/php-fpm
- service php-fpm start
- chkconfig php-fpm on
PHP5.3安装
最新推荐文章于 2024-08-29 14:28:28 发布