php-7.3.6 编译安装过程

这篇文章主要介绍了php-7.3.6 编译安装过程,本文通过实例文字相结合给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下。

1.、安装编译工具及库文件(使用yum命令安装)

yum install -y apr* autoconf automake bison bzip2 bzip2* cloog-ppl cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libxml* libXaw-devel libXmu-devel libtiff libtiff* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* wget zlib-devel

2.安装 libzip 扩展

  1. wget https://nih.at/libzip/libzip-1.2.0.tar.gz
  2. tar -zxvf libzip-1.2.0.tar.gz
  3. cd libzip-1.2.0
  4. ./configure
  5. make
  6. make install
  7. cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

3. 官网下载-下载3.6

wget http://cn2.php.net/distributions/php-7.3.3.tar.gz

编译安装 扩展

  1. cd /usr/local/src/
  2. git clone https://github.com/websupport-sk/pecl-memcache
  3. cd pecl-memcache/
  4. /usr/local/php7/bin/phpize
  5. ./configure --with-php-config=/usr/local/php7/bin/php-config
  6. make && make install
  7. yum install libmemcached libmemcached-devel -y
  8. cd /usr/local/src/
  9. wget https://pecl.php.net/get/memcached-3.1.3.tgz
  10. tar -zxvf memcached-3.1.3.tgz
  11. cd memcached-3.1.3
  12. /usr/local/php7/bin/phpize
  13. ./configure --with-php-config=/usr/local/php7/bin/php-config
  14. make && make install
  15. cd /usr/local/src/
  16. wget https://pecl.php.net/get/redis-4.3.0.tgz
  17. tar -zxvf redis-4.3.0.tgz
  18. cd redis-4.3.0
  19. /usr/local/php7/bin/phpize
  20. ./configure --with-php-config=/usr/local/php7/bin/php-config
  21. make && make install

安装 mcrypt扩展

  1. yum install libmcrypt libmcrypt-devel mcrypt mhash -y
  2. cd /usr/local/src/
  3. wget http://pecl.php.net/get/mcrypt-1.0.1.tgz
  4. tar xf mcrypt-1.0.1.tgz
  5. cd mcrypt-1.0.1
  6. /usr/local/php7/bin/phpize
  7. ./configure --with-php-config=/usr/local/php7/bin/php-config && make && make install

在php.ini加上扩展即可

extension=memcache.so

extension=memcached.so

extension=redis.so

extension=mcrypt.so