• <span id="ycodp"></span>
    <span id="ycodp"><small id="ycodp"></small></span>
    1. <label id="ycodp"></label>
      <rt id="ycodp"><tr id="ycodp"><strike id="ycodp"></strike></tr></rt>
      <i id="ycodp"><strong id="ycodp"><ul id="ycodp"></ul></strong></i>
    2. 幫助中心

      這里有最新的使用文檔和教程

      < 返回

      CentOS 8.x下編譯php多版本報(bào)錯(cuò)處理

      2023-04-15 16:14 作者:31IDC 閱讀量:2223 所屬分類(lèi):Linux系統(tǒng)

      CentOS 8.x下編譯php 7.4、php5.6、php5.3多版本報(bào)錯(cuò)處理

      一、編譯安裝php 7.4.x

       

      參考CentOS 8.0.1905編譯安裝Nginx1.16.1+MySQL8.0.18+PHP7.3.10

       

      1、安裝編譯工具及庫(kù)文件(使用yum命令安裝)

       

      yum install apr* autoconf automake bison bzip2 bzip2* cpp curl curl-devel fontconfig fontconfig-devel freetype-devel gcc gcc-c++ gd gd-devel 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 openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet wget zlib-devel ncurses-devel libtirpc-devel gtk* ntpstat bison* sqlite-devel  oniguruma libzip-devel

       

      2、編譯php 7.4.x 需要安裝oniguruma

       

      cd /usr/local/src

       

      wget https://github.com/kkos/oniguruma/archive/v6.9.4.tar.gz -O oniguruma-6.9.4.tar.gz

       

      或者

       

      wget http://down.24kplus.com/linux/oniguruma/oniguruma-6.9.4.tar.gz

       

      tar -zxf oniguruma-6.9.4.tar.gz

       

      cd oniguruma-6.9.4

       

      ./autogen.sh

       

      ./configure --prefix=/usr

       

      make

       

      make install

       

      3、編譯php 7.4.x 需要安裝libzip

       

      cd /usr/local/src

       

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

       

      tar -zxvf libzip-1.2.0.tar.gz

       

      cd libzip-1.2.0

       

      ./configure

       

      make

       

      make install

       

      cp /usr/local/lib/libzip/include/zipconf.h  /usr/local/include/zipconf.h

       

      #拷貝文件,否則安裝php可能會(huì)報(bào)錯(cuò) /usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or dire

       

      4、php 7.4.x編譯參數(shù)

       

      export LD_LIBRARY_PATH=/usr/local/libgd/lib #設(shè)置libgd庫(kù)環(huán)境變量

       

      export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" #設(shè)置libzip環(huán)境變量

       

      ./configure --prefix=/usr/local/php74 --with-config-file-path=/usr/local/php74/etc --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-gd --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --with-xpm=/usr/lib64 --with-zlib-dir=/usr/local/zlib --with-iconv --with-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --with-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --enable-ctype --enable-mysqlnd --enable-pdo

       

      make #編譯

       

      make install #安裝

       

      ./configure --help #可以查看編譯參數(shù)的寫(xiě)法

       

      5、編譯php報(bào)錯(cuò)

       

      5.1 沒(méi)有設(shè)置libzip環(huán)境變量export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

       

      No package 'libzip' found

       

      checking for libzip >= 0.11... no

       

      configure: error: Package requirements (libzip >= 0.11) were not met:

       

      No package 'libzip' found

       

      Consider adjusting the PKG_CONFIG_PATH environment variable if you

       

      installed software in a non-standard prefix.

       

      Alternatively, you may set the environment variables LIBZIP_CFLAGS

       

      and LIBZIP_LIBS to avoid the need to call pkg-config.

       

      See the pkg-config man page for more details.

       

      5.2缺少sqlite3庫(kù) yum install  sqlite-devel

       

      error: Package requirements (sqlite3 > 3.7.4) were not met

       

      error: Package requirements (sqlite3 > 3.7.4) were not met

       

      No package 'sqlite3' found

       

      5.3缺少oniguruma 編譯安裝oniguruma

       

      error: Package requirements (oniguruma) were not met

       

      error: Package requirements (oniguruma) were not met

       

      No package 'oniguruma' found

       

      二、編譯安裝php 5.6.x

       

      1、安裝低版本的openssl

       

      CentOS 8.x默認(rèn)的openssl版本太高,與php 5.6.x不兼容,需要降低openssl版本才能編譯成功

       

      which openssl #查詢(xún)openssl目錄,如/usr/include/openssl

       

      openssl version #查看openssl版本

       

      cd /usr/local/src

       

      mkdir /usr/local/openssl101e

       

      tar zxvf openssl-1.0.1e.tar.gz

       

      cd openssl-1.0.1e

       

      ./config --prefix=/usr/local/openssl101e

       

      make

       

      make install

       

      如果安裝報(bào)錯(cuò):

       

      cms.pod around line 457: Expected text after =item, not a number

       

      cms.pod around line 461: Expected text after =item, not a number

       

      cms.pod around line 465: Expected text after =item, not a number

       

      cms.pod around line 470: Expected text after =item, not a number

       

      cms.pod around line 474: Expected text after =item, not a number

       

      POD document had syntax errors at /usr/bin/pod2man line 69.

       

      make: *** [install_docs] Error 1

       

      rm -f /usr/bin/pod2man #執(zhí)行本行代碼,再重新編譯安裝

       

      export PATH=/usr/local/openssl101e/bin:$PATH

       

      export LD_LIBRARY_PATH=/usr/local/openssl101e/lib

       

      export LC_ALL="en_US.UTF-8"

       

      export LDFLAGS="-L/usr/local/openssl101e/lib -Wl,-rpath,/usr/local/openssl101e/lib"

       

      2、php 5.6.x編譯參數(shù)

       

      ./configure --prefix=/usr/local/php56 --with-config-file-path=/usr/local/php56/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd=/usr/local/libgd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-xpm-dir=/usr/lib64 --with-vpx-dir=/usr/local/libvpx/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl-dir=/usr/local/openssl101e --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype --enable-mysqlnd

       

      #注意--with-openssl-dir=/usr/local/openssl101e 是我們安裝的openssl低版本目錄

       

      二、編譯安裝php 5.3.x

       

      CentOS 8.x默認(rèn)的openssl版本太高,與php 5.3.x不兼容,需要降低openssl版本才能編譯成功

       

      php 5.3.x 需要低版本的gd庫(kù)gd-2.0.35.tar.gz

       

      gd-2.0.35庫(kù)編譯參數(shù)

       

      ./configure --prefix=/usr/local/gd --enable-shared --with-jpeg=/usr/local/jpeg --with-png=/usr/local/libpng --with-freetype=/usr/local/freetype --with-fontconfig=/usr/local/freetype --with-xpm=/usr/lib64 --with-tiff=/usr/local/tiff --with-vpx=/usr/local/libvpx

       

      php 5.3.x編譯參數(shù)

       

      ./configure --prefix=/usr/local/php53 --with-config-file-path=/usr/local/php53/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-freetype-dir=/usr/lib --with-iconv --with-zlib-dir=/usr/local/zlib --enable-xml --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl-dir=/usr/local/openssl101e --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype --with-mysqli=shared --enable-mysqlnd

       

      注意:--with-openssl-dir=/usr/local/openssl101e 是我們安裝的openssl低版本目錄

       

      CentOS 8.x下編譯安裝php 5.5 php 5.4也和php 5.6一樣,需要降低openssl版本才能編譯成功。

       

       

      至此,CentOS 8.x下編譯php 7.4、php5.6、php5.3多版本報(bào)錯(cuò)處理教程完成。

      31IDC - 12 年深耕海外 IDC 高端資源

      主站蜘蛛池模板: 天天干天天色综合| 国产99久久亚洲综合精品| 色狠狠久久综合网| 一日本道伊人久久综合影| 亚洲人成在久久综合网站| 亚洲综合小说另类图片动图| 亚洲国产综合精品一区在线播放 | 亚洲综合精品网站在线观看| 亚洲国产婷婷综合在线精品| 亚洲狠狠久久综合一区77777 | 亚洲国产成人九九综合| 色噜噜狠狠狠狠色综合久 | 色婷婷综合中文久久一本| 综合三区后入内射国产馆| 婷婷久久香蕉五月综合| 久久综合九色综合97伊人麻豆 | 狠狠色丁香久久婷婷综合蜜芽五月 | 一本色道久久综合亚洲精品蜜桃冫| 区二区三区激情综合 | 中文网丁香综合网| 伊伊人成亚洲综合人网7777| 综合五月激情二区视频| 色综合久久综合中文综合网| 久久精品综合一区二区三区| 日日狠狠久久偷偷色综合0| 国产成人麻豆亚洲综合无码精品| 欧美日韩综合一区二区三区| 老色鬼久久亚洲AV综合| 久久久久久久综合日本| 一本色综合网久久| 国产亚洲综合视频| 亚洲国产精品综合久久网络| 天天影视综合网色综合国产| 亚洲伊人色一综合网| 制服丝袜人妻综合第一页| 色噜噜成人综合网站| 久久天堂av综合色无码专区| 色婷婷99综合久久久精品| 国产激情综合在线观看| 麻豆精品久久精品色综合| 色综合天天做天天爱|