安装编译依赖

sudo apt-get -y install build-essential git autoconf
sudo apt-get build-dep php5
sudo apt-get -y install libt1-dev libgmp-dev bison
sudo apt-get -y install mysql-server mysql-client libmysqlclient-dev
apt-get install libfcgi-dev libfcgi0ldbl ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h

编译选项

./configure --prefix=/usr --with-config-file-path=/etc --enable-mbstring --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-curl --with-mcrypt --with-iconv --with-gmp --with-pspell --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-xpm-dir=/usr --with-freetype-dir=/usr --with-t1lib=/usr --enable-gd-native-ttf --enable-gd-jis-conv --with-openssl --with-pdo-mysql=/usr --with-gettext=/usr --with-zlib=/usr --with-bz2=/usr --with-recode=/usr --with-mysqli=/usr/bin/mysql_config  --with-apxs2=/usr/bin/apxs2

具体的configure参数信息可以通过

./configure --help

查看到

开始编译安装

make && make install

提示缺少apxs:

在Ubuntu中,采用

  sudo apt-get install apache2

安装apache服务后,是不会带Apxs,需要安装 apache2-dev。其命令是:

 sudo apt-get install apache2-dev

安装完后查看安装的路径:find / -name 'apxs2'

configure: error: Cannot find OpenSSL's <evp.h>

 sudo apt-get install libcurl4-openssl-dev pkg-config

然后继续使用--with-openssl 不用带路径

configure: error: freetype-config not found.

解决办法如下:

 apt-get -y install libfreetype6-dev

configure: error: Cannot find ldap libraries in /usr/lib

把 /usr/lib/x86..../目录下的libldap*文件拷贝到 /usr/lib

 cp /usr/lib/x86_64-linux-gnu/libldap* /usr/lib

configure: error: Can not find recode.h anywhere under yes /usr/local /usr /opt

 sudo apt-get install librecode-dev

Linux下编译软件如果遇到can not find 问题大多可以通过

 sudo apt list '*缺少的文件名*‘

来查找的然后安装既可以,最后PHP7就安装好了。

 

可以参考:http://jcutrer.com/howto/linux/how-to-compile-php7-on-ubuntu-14-04

Ubuntu编译PHP7问题的更多相关文章

  1. Ubuntu编译安装php7.4

    Ubuntu编译安装php7.4  [root@ubuntu2004 php-7.4.30]#apt install gcc libssl-dev libxml2-dev libsqlite3-dev ...

  2. TODO:macOS编译PHP7.1

    TODO:macOS编译PHP7.1 本文主要介绍在macOS上编译PHP7.1,有兴趣的朋友可以去尝试一下. 1.下载PHP7.1源码,建议到PHP官网下载纯净到源码包php-7.1.0.tar.g ...

  3. Ubuntu 编译安装 Linux 4.0.5 内核,并修复 vmware 网络内核模块编译错误

    . . . . . 今天把 Ubuntu 14.04 升级到了最新的 4.0.5 的内核版本,本来不打算记录下来的,但是升级的过程中确实遇到了一些问题,所以还是记录下来,分享给遇到同样问题的猿友. 先 ...

  4. linux 解决Ubuntu编译内核uImage出现问题“mkimage” command not found - U-Boot images will not be built问题

    解决Ubuntu编译内核uImage出现问题“mkimage” command not found - U-Boot images will not be built问题 http://www.lin ...

  5. ubuntu 编译运行 opencv C++ 项目

    ubuntu 编译运行 opencv C++ 项目 环境 ubuntu 16.04 opencv3.4.0 一. 编译方法 1)命令行 g++ imageResize.cpp -o resize `p ...

  6. windows下编译php7图形库php_ui.dll

    CSDN博客 具有图形化编程才有意思,这几天看到了php ui 图形扩展,只是现在只能下载php 7.1的 本次教程编译php7.2.6的 php ui 要是linux下编译起来比较简单 但是 win ...

  7. Ubuntu编译安装nginx,php,mysql

    摘要: 整理的Ubuntu编译安装nginx,php,mysql的步骤,主要来自对驻云的sh-1.4.1中脚本的整理,随时代进步,内容中的软件或者命令请自行更新 目录准备 创建用户 userdel w ...

  8. Ubuntu 编译安装 nginx

    有关博客: <Windows 编译安装 nginx 服务器 + rtmp 模块>.<Ubuntu 编译安装 nginx>.<Arm-Linux 移植 Nginx> ...

  9. Ubuntu编译安装PHP7

    参数配置 ./configure --prefix=/usr/local/php7 \ --with-config-file-path=/usr/local/php7/etc \ --with-apx ...

随机推荐

  1. 十分钟入门less(翻译自:Learn lESS in 10 Minutes(or less))

    十分钟入门less(翻译自:Learn lESS in 10 Minutes(or less)) 注:本文为翻译文章,因翻译水平有限,难免有缺漏不足之处,可查看原文. 我们知道写css代码是非常枯燥的 ...

  2. BZOJ4445: [Scoi2015]小凸想跑步

    裸半平面交. 记得把P0P1表示的半平面加进去,否则点可能在多边形外. #include<bits/stdc++.h> #define N 100009 using namespace s ...

  3. IIS------配置错误:不能在此路径中使用此配置节

    转载: http://wenda.so.com/q/1414673956725716 因为 IIS 采用了更安全的 web.config 管理机制,默认情况下会锁住配置项不允许更改.运行命令行 %wi ...

  4. 爬虫4 html输出器 html_outputer.py

    #coding:utf8 __author__ = 'wang' class HtmlOutputer(object): def __init__(self): self.datas = []; de ...

  5. 9月19日下午JavaScript数组冒泡排列和二分法

    数组 一.冒泡排列 对数组attr = [1,8,6,4,5,3,7,2,9]进行由大到小排列,用冒泡排列的方法排列时,会对数组进行比较互换.如果前一个数字较大,这2个元素排列方式不变,如果后一个元素 ...

  6. ecshop 版权问题 Powered by ECShop

    将下代码 <div style="width:0px;height: 0px;overflow:hidden;">{foreach from=$lang.p_y ite ...

  7. Unity 下载

    Unity历史版本 http://wiki.ceeger.com/unity:history#unity_522f1 UNITY 下载存档 http://unity3d.com/cn/get-unit ...

  8. asp.net常用函数表

    文章转载于[IT花园]:http://www.itgarden.com.cn/showtopic-29.aspx Abs(number) 取得数值的绝对值. Asc(String) 取得字符串表达式的 ...

  9. Django基础,Day10 - template 模板引擎与路径设置

    作为一个Web框架,Django需要一个方便的方式来生成动态的HTML.最常见的方法依赖于模板.模板包含所需的HTML输出的静态部分以及一些特殊的语法描述如何插入动态内容. Django框架后端默认支 ...

  10. Python 开发与测试 Webservice(SOAP)

    WebService是一种跨编程语言和跨操作系统平台的远程调用技术. 理解WebService 1.从表面上看,WebService就是一个应用程序向外界暴露出一个能通过Web进行调用的API,也就是 ...