PHP7.3.2安裝


#安裝相關依賴包

yum install zlib-devel libxml2-devel libjpeg-devel libjepg-turbo-devel libiconv-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libmcrpt-devel mhash bzip2-devel postgresql-devel libzip-devel

  • wget https://nih.at/libzip/libzip-1.2.0.tar.gz
  • tar -zxvf libzip-1.2.0.tar.gz
  • cd libzip-1.2.0

#下載並解壓php

wget http://cn2.php.net/distributions/php-7.3.2.tar.bz2         

#####編譯檢查

若編譯zip失敗可以在confiure前加PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig

'./configure' '--prefix=/usr/local/php' '--with-pdo-pgsql' '--with-zlib-dir=/usr/local/lib/libzip' '--with-freetype-dir=/usr/include/freetype2/freetype' '--enable-mbstring' '--with-libxml-dir=/usr' '--enable-soap' '--enable-calendar' '--with-curl' '--with-gd' '--with-pgsql' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-zlib' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl' '--enable-mbregex' '--enable-exif' '--enable-bcmath' '--with-mhash' '--enable-zip' '--with-pcre-regex' '--with-pdo-mysql' '--with-mysqli' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-openssl' '--with-fpm-user=www' '--with-fpm-group=www' '--with-libdir=/lib/x86_64-linux-gnu/' '--enable-ftp' '--with-gettext' '--with-xmlrpc' '--with-xsl' '--enable-opcache' '--enable-fpm' '--with-iconv' '--with-xpm-dir=/usr'
make #編譯
make install #安裝

###創建配置文件,並將其復制到正確的位置

cp php.ini-development /usr/local/php/php.ini

cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf

cp sapi/fpm/php-fpm /usr/local/bin

相關鏈接:nginx配置php


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM