zoukankan      html  css  js  c++  java
  • Ubuntu编译PHP7问题

    安装编译依赖

    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中,采用

    1  sudo apt-get install apache2

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

    1 sudo apt-get install apache2-dev


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

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

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

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

    configure: error: freetype-config not found.

    解决办法如下:

    1 apt-get -y install libfreetype6-dev

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

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

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

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

    1 sudo apt-get install librecode-dev

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

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

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

     

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

  • 相关阅读:
    题解CF566D Restructuring Company
    题解CF986F Oppa Funcan Style Remastered
    题解P2371 [国家集训队]墨墨的等式
    题解 CF1203D2 Remove the Substring (hard version)
    题解 CF1202D Print a 1337-string...
    ubuntu apt-get install php
    jwt refresh token
    读过的laravel文章
    delete all untracked files
    自定义UserProvider,更改验证方法
  • 原文地址:https://www.cnblogs.com/yangxunwu1992/p/5574918.html
Copyright © 2011-2022 走看看