Ubuntu14.04 安装 PHP7.3

  1. sudo apt-get install libxml2-dev
    sudo apt-get install libcurl3-openssl-dev
    sudo apt-get install libcurl4-gnutls-dev
    sudo apt-get install libbz2-dev
    sudo apt-get install libjpeg-dev
    sudo apt-get install libpng-dev
    sudo apt-get install libxpm-dev
    sudo apt-get install libfreetype6-dev
    sudo apt-get install libmcrypt-dev
    sudo apt-get install libmysql++-dev
    sudo apt-get install libxslt1-dev
  2. wget https://www.php.net/distributions/php-7.3.9.tar.bz2
  3. tar xvf php-7.3.9.tar.bz2
  4. cd php-7.3.9
  5. ./configure –prefix=/usr/local/php –enable-fpm –enable-sockets –enable-mbstring=all -enable-mysqlnd —with-config-file-path=/usr/local/php/etc —with-mysqli=mysqlnd —with-pdo-mysql=mysqlnd —with-curl —with-gd
  6. make -j2
  7. sudo make install
  8. sudo cp php.ini-development /usr/local/php/etc/php.ini
  9. cd /usr/local/php/etc
  10. sudo cp php-fpm.conf.default php-fpm.conf
  11. cd /usr/local/php/etc/php-fpm.d
  12. sudo cp www.conf.default www.conf
  13. sudo vim /etc/profile
  14. //将下面的一句话加到末尾
    export PATH=$PATH:/usr/local/php/bin
  15.  source /etc/profile
    php -v //出现版本号说明安装成功
    php -m //查看你安装的依赖
  16. 安装扩展需要openssl
    sudo apt-get install m4
    sudo apt-get -y install autoconf
  17. sudo apt-get install libssl-dev
  18. cd /php-7.3.9/ext/openssl
  19. cp config0.m4 config.m4 //有的扩展没有config.m4但有config0.m4
  20. phpize
  21. ./configure –with-php-config=/usr/local/php/bin/php-config //我们的php安装目录下
  22. make
  23. sudo make install
  24. sudo vim /usr/local/php/etc/php.ini
  25. Ubuntu安装php7.3
  26. so文件被拷贝到了/usr/local/php/lib/php/extensions/no-debug-non-zts-20180731/