美文网首页
Debian系统编译安装PHP7.2.3

Debian系统编译安装PHP7.2.3

作者: ysnows | 来源:发表于2018-03-15 12:41 被阅读1341次
    1. 安装依赖
    apt-get install  libxml2-dev libssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libgmp-dev libgmp3-dev libmcrypt-dev libmysqlclient15-dev libpspell-dev librecode-dev libcurl4-gnutls-dev libgmp-dev libgmp3-dev librecode-dev libpspell-dev  libmysqlclient15-dev  libmcrypt-dev  libreadline-dev libtidy-dev libxslt1-dev  -y
     
    
    1. 下载php7.2.3源码wget http://cn2.php.net/distributions/php-7.2.3.tar.gz,解压
    2. 配置
    ./configure \
    --prefix=/usr/local/php \
    --with-config-file-path=/etc \
    --enable-fpm \
    --with-fpm-user=nginx  \
    --with-fpm-group=nginx \
    --enable-inline-optimization \
    --disable-debug \
    --disable-rpath \
    --enable-shared  \
    --enable-soap \
    --with-libxml-dir \
    --with-xmlrpc \
    --with-openssl \
    --with-mcrypt \
    --with-mhash \
    --with-pcre-regex \
    --with-sqlite3 \
    --with-zlib \
    --enable-bcmath \
    --with-iconv \
    --with-bz2 \
    --enable-calendar \
    --with-curl \
    --with-cdb \
    --enable-dom \
    --enable-pcntl \
    --enable-exif \
    --enable-fileinfo \
    --enable-filter \
    --with-pcre-dir \
    --enable-ftp \
    --with-gd \
    --with-openssl-dir \
    --with-jpeg-dir \
    --with-png-dir \
    --with-zlib-dir  \
    --with-freetype-dir \
    --enable-gd-native-ttf \
    --enable-gd-jis-conv \
    --with-gettext \
    --with-gmp \
    --with-mhash \
    --enable-json \
    --enable-mbstring \
    --enable-mbregex \
    --enable-mbregex-backtrack \
    --with-libmbfl \
    --with-onig \
    --enable-pdo \
    --with-mysqli=mysqlnd \
    --with-pdo-mysql=mysqlnd \
    --with-zlib-dir \
    --with-pdo-sqlite \
    --with-readline \
    --enable-session \
    --enable-shmop \
    --enable-simplexml \
    --enable-sockets  \
    --enable-sysvmsg \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-wddx \
    --with-libxml-dir \
    --with-xsl \
    --enable-zip \
    --enable-mysqlnd-compression-support \
    --with-pear \
    --enable-opcache
    
    1. 错误configure: error: no acceptable C compiler found in $PATH,执行apt-get install build-essential安装c,gcc之类的东西

    2. 错误 configure: error: Cannot find OpenSSL's libraries,解决方案

      1. ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/

      2. 或者编译安装

        wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
        tar zxf openssl-1.0.2k.tar.gz
        cd openssl-1.0.2k
        ./config
        make && make install 
      
    3. 错误configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/,解决方案:
      1. sudo apt-get install libcurl4-gnutls-dev
      2. cd /usr/include sudo ln -s x86_64-linux-gnu/curl

    4. 错误configure: error: freetype-config not found.,解决方案:
      1. apt-get install libfreetype6-dev

    5. 错误configure: error: Unable to locate gmp.h解决方案:

      1. apt-get install libgmp-dev
    6. 错误configure: error: Please reinstall readline - I cannot find readline.h,解决方案:

      1. apt-get install libreadline-dev./
    7. make && make install

    参考:debian系统安装最新lnmp编译最新php7.1.2及nginx1.10.3及mysql5.7及5.6

    相关文章

      网友评论

          本文标题:Debian系统编译安装PHP7.2.3

          本文链接:https://www.haomeiwen.com/subject/ymfhqftx.html