编译安装PHP 时遇到问题解决方法.

环境:centos X64 最小化安装

php版本:php-5.4.3

安装前.先安装些软件和库文件

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

领导要我们自己手动装 不允许我们直接用yum 所以上面的都没执行

编译安装PHP

进入php的解压目录

./configure --prefix=/usr/local/php --enable-fpm  --with-mcrypt=/usr/local/libmcrypt --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysqli --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf  --enable-pdo --with-pdo-mysql --with-gettext --with-curl --with-pdo-mysql --enable-sockets --enable-bcmath --enable-xml --with-bz2 --enable-zip --enable-freetype

运行之后遇到的问题:

error 1

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

(看提示就明白 是一个lib库没装  先用 yum search 名字 看是否能搜到名字 ,找到名字后 把软件包 开发包装上)

解决办法

yum install libxml2-devel.x86_64

error 2

checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>

这是ssl没装

解决办法

 yum  install  openssl.x86_64 openssl-devel.x86_64 -y

error 3

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

这是bzip2软件包没有安装

解决办法

yum install bzip2-devel.x86_64 -y

error 4

configure: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/

curl和curl库文件没有安装

解决办法

yum install libcurl.x86_64 libcurl-devel.x86_64 -y

error 5

checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
configure: error: jpeglib.h not found

GD库没有安装

解决办法

yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y

error 6

checking for stdarg.h... (cached) yes
checking for mcrypt support... yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt.

libmcrypt库没有安装 ,要是不能用yun安装的话  就要去下载个gz包 自己编译安装

(编译安装  ./configure --piefix=/usr/local/libmcrypt   make && make install)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

要是错误里面含有mysql的  那是mysql-devel 没有安装

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

出现

Generating files configure: creating ./config.status creating main/internal_functions.c creating main/internal_functions_cli.c

+--------------------------------------------------------------------+

| License:                                                           |

| This software is subject to the PHP License, available in this     |

| distribution in the file LICENSE.  By continuing this installation |

| process, you are bound by the terms of this license agreement.     |

| If you do not agree with the terms of this license, you must abort |

| the installation process at this point.                            |

+--------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php5.spec

config.status: creating main/build-defs.h

config.status: creating scripts/phpize

config.status: creating scripts/man1/phpize.1

config.status: creating scripts/php-config

config.status: creating scripts/man1/php-config.1

config.status: creating sapi/cli/php.1

config.status: creating sapi/fpm/php-fpm.conf

config.status: creating sapi/fpm/init.d.php-fpm

config.status: creating sapi/fpm/php-fpm.8

config.status: creating sapi/fpm/status.html

config.status: creating main/php_config.h

config.status: executing default commands

表示安装成功

make  && make install

make完成之后  到php的解压目录 找出php.ini-production 复制到 /usr/local/php/lib/ 下 文件名改成php.ini

cp php.ini-production /usr/local/php/lib/php.ini

完成..

PS:不知道美国那边的源是不是好一些 很多的包 在中国需要手动下载  在美国的服务器上 能直接用yum.......

人生其实就这样,睁一只眼,闭一只眼,就这样过去了

转载于:https://blog.51cto.com/imperialzhang/1727282

php common errors相关推荐

  1. org.apache.kafka.common.errors.TimeoutException: Topic not present in metadata 解决方法

    [README] 本文po出了 topic not present in metadata 的解决方法: 很多博文说是 因为  jackson-databind 没有引入,但是我重新引入后,还是没有解 ...

  2. kafka消费报错:org.apache.kafka.common.errors.WakeupException: null

    文章目录 1. 背景 1. 背景 我在测试类中写一个kafka消费者的线程,大概结构如下 @Testpublic void startMeteorTask() {thread.run(){

  3. 开放神经网络交换(ONNX)工具

    开放神经网络交换(ONNX)工具 开放神经网络交换(ONNX)是一个开放的生态系统,它使人工智能开发人员能够在项目发展过程中选择正确的工具.ONNX为人工智能模型提供了一种开源格式,包括深度学习和传统 ...

  4. kafka 异步发送阻塞_Kafka学习一

    一.github下载kafka的源码 可以看到kafka的源码开源社区是非常活跃的. 二.搭建kafka环境 构建kafka环境,首先需要安装Scala和gradle,再安装的scala插件需要和你的 ...

  5. 编写文档_如何通过编写优质文档来使自己的未来快乐

    编写文档 by Gabriele Cimato 加布里埃莱·西马托(Gabriele Cimato) 如何通过编写优质文档来使自己的未来快乐 (How to make your future self ...

  6. babel6 babel7_当您已经准备好Babel时设置Flow

    babel6 babel7 by Jamie Kyle 杰米·凯尔(Jamie Kyle) 当您已经准备好Babel时设置Flow (Setting up Flow when you've alrea ...

  7. javascript优缺点_为什么要在JavaScript中使用静态类型? 优缺点

    javascript优缺点 by Preethi Kasireddy 通过Preethi Kasireddy 为什么要在JavaScript中使用静态类型? 优缺点 (Why use static t ...

  8. 对象冒充_使用您的精神探照灯进行冒充冒名顶替综合症

    对象冒充 by Jaime J. Rios 由Jaime J. Rios "Stop that imposter! Seize them!" "停止冒名顶替者! 抓住他们 ...

  9. 深入理解Kafka Connect:转换器和序列化

    AI前线导读:Kafka Connect是一个简单但功能强大的工具,可用于Kafka和其他系统之间的集成.人们对Kafka Connect最常见的误解之一是它的转换器.这篇文章将告诉我们如何正确地使用 ...

最新文章

  1. 局部内部类访问方法中的局部变量为什么加final
  2. Android的NDK开发(3)————JNI数据类型的详解
  3. damage framework can be used by economics
  4. 服务容错设计:流量控制、服务熔断、服务降级
  5. 计算机网络-思维导图(4)网络层
  6. 前端学习(2708):重读vue电商网站28之通过axios请求拦截器添加 token
  7. 一步一步写算法(之二叉树深度遍历)
  8. Linux shell实例精讲 (一)
  9. 深度学习自学(四):NCNN配置openmp-CMAKELIST
  10. 一个伤心人的帖和一群搞笑的跟帖
  11. javascript复习总结
  12. 玻尔原子模型中各轨道半径、轨道能量公式推导
  13. 华为linux输入法,华为默认手机输入法原来还能这么玩??涨知识了
  14. 什么是EMC?什么是EMI?什么是EMS?电磁兼容详解(一)
  15. 关于多线程爬取小说排序混乱的问题
  16. msm8916 lcd 相关调试点指导
  17. 聊天的一点笔记--顺便浅谈技术服务公司的激励制度设计
  18. 系统安装部署系列教程(一):安装原版系统镜像
  19. 第三方浏览器内核嵌入一、Crosswalk
  20. 白魔法师(牛客小白月赛25 图、并查集)

热门文章

  1. Windchill的web中的Spring
  2. 2017年7月十三日正式开始记录
  3. 三星为何要在安卓之外开发 Tizen 系统?
  4. 批处理解决本地连接无法禁用问题
  5. Promise--感性认知
  6. 剑指offer 刷题 01
  7. 批号数量调整单中批次数量和库存数量不一致
  8. Zend Studio 10正式版破解(2013-02-26更新)
  9. TFS命令tf:undo - 强制签入别人签出的文件
  10. jQuery对下拉框、单选框、多选框的处理