zoukankan      html  css  js  c++  java
  • PHP编译常见错误

    一、PHP编译

      (一)、依赖环境

    编译常用依赖包:

    yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libxslt libxslt-devel

      (二)、编译参数

    常用编译参数:

    ./configure 
    --prefix=/usr/local/php
    --with-curl
    --with-freetype-dir
    --with-gd
    --with-ldap
    --with-gettext
    --with-iconv-dir
    --with-jpeg-dir
    --with-kerberos
    --with-libdir=lib64
    --with-libxml-dir
    --with-mysqli
    --with-openssl
    --with-pcre-regex
    --with-pdo-mysql
    --with-pdo-sqlite
    --with-pear
    --with-png-dir
    --with-xmlrpc
    --with-xsl
    --with-zlib
    --enable-fpm
    --enable-bcmath
    --enable-libxml
    --enable-inline-optimization
    --enable-mbregex
    --enable-mbstring
    --enable-opcache
    --enable-pcntl
    --enable-shmop
    --enable-soap
    --enable-sockets
    --enable-sysvsem
    --enable-xml
    --enable-zip
    --with-fpm-group=nginx
    --with-fpm-user=nginx

    二、编译安装PHP常见错误

      (一)、错误一

    checking for xml2-config path... 
    configure: error: xml2-config not found. Please check your libxml2 installation.

    解决方法:

    yum -y install libxml2-devel

      (二)、错误二

    checking for BZip2 in default path... not found
    configure: error: Please reinstall the BZip2 distribution

    解决方法:

    yum install -y  bzip2-devel

      (三)、错误三

    If configure fails try --with-vpx-dir=
    configure: error: png.h not found.

    解决方法:

    yum -y install libpng-devel

      (四)、错误四

    If configure fails try --with-xpm-dir=
    configure: error: freetype.h not found.

    解决方法:

    yum -y install freetype-devel

      (五)、错误五

    checking for specified location of the MySQL UNIX socket... no
    configure: error: Cannot find MySQL header files under /usr/local/mysql.
    Note that the MySQL client library is not bundled anymore!

    解决方法:

    yum -y install mysql
    #没有安装mysql数据导致,安装mysql即可

      (六)、错误六

    configure: error: mcrypt.h not found. Please reinstall libmcrypt.

    解决方法:

    #安装libmcrypt
    wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
    tar -zxvf libmcrypt-2.5.7.tar.gz
    cd libmcrypt-2.5.7
    mkdir -p /usr/local/libmcrytp
    ./configure prefix=/usr/local/libmcrytp/
    make
    make install
  • 相关阅读:
    五分钟带你了解啥是JWT
    软件系统方案设计
    基于工程实践的需求分析和概念原型
    Linux添加环境变量与GCC编译器添加INCLUDE与LIB环境变量
    ssh链接到minikube虚拟机
    error converting YAML to JSON: yaml: line 3: mapping values are not allowed in this context
    CentOS 7 virt-manager “authentication failed”错误及解决方法
    centos安装docker
    kali安装php-gd
    mariadb忘记root密码
  • 原文地址:https://www.cnblogs.com/sky-k/p/9365774.html
Copyright © 2011-2022 走看看