博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PHP7源码编译安装
阅读量:7031 次
发布时间:2019-06-28

本文共 4803 字,大约阅读时间需要 16 分钟。

hot3.png

源码编译安装

  • 环境 OS: 14.04.1-Ubuntu PHP: php7.0.0

下载地址

  • web下载地址
  • 真实下载地址

下载解压

//进入要存放文件包目录 比如 /opt    cd /opt    sudo wget http://cn2.php.net/get/php-7.0.0.tar.gz/from/this/mirror    sudo mv mirror php-7.0.0.tar.gz    sudo tar -axvf php-7.0.0.tar.gz

编译安装

./configure --prefix=/usr/local/php --enable-fpm --enable-mbstring --disable-pdo --with-curl=/usr/local/curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysqli --with-gd --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/png --with-mcrypt=/usr/local/libmcrypt    sudo make    sudo make install

错误及解决

  • PS:错误&&解决方法非顺序出现
no acceptable C compiler found in $PATH
# err        configure: error: in `/opt/php-7.0.0':        configure: error: no acceptable C compiler found in $PATH             # solve     sudo apt-get install gcc
Unable to fetch some archives
# err    Err http://security.ubuntu.com/ubuntu/ trusty-security/main linux-libc-dev amd64 3.13.0-68.111      404  Not Found [IP: 91.189.91.13 80]    Fetched 18.5 MB in 24s (768 kB/s)    E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_3.13.0-68.111_amd64.deb  404  Not Found [IP: 91.189.91.13 80]        E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?        # solve    sudo sudo apt-get update
configure: error: xml2-config not found. Please check your libxml2 installation.
# err    configure: error: xml2-config not found. Please check your libxml2 installation.        # solve    sudo apt-get install libxml2    sudo apt-get install libxml2-dev
Cannot find libz
# err    configure: error: Cannot find libz        # solve    sudo curl -O http://zlib.net/zlib-1.2.8.tar.gz    sudo tar -zxvf zlib-1.2.8.tar.gz    cd zlib-1.2.8/    sudo ./configure    sudo make    sudo make install
The program 'make' is currently not installed
# err    The program 'make' is currently not installed. You can install it by typing:    sudo apt-get install make        # solve    sudo apt-get install make
configure: error: Please reinstall the BZip2 distribution
# err    checking for BZip2 in default path... not found    configure: error: Please reinstall the BZip2 distribution        # solve    sudo curl -O http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz    sudo tar -zxvf bzip2-1.0.6.tar.gz    sudo make    sudo make install
configure: error: Please reinstall the libcurl distribution
# err    checking for cURL support... yes    checking for cURL in default path... not found    configure: error: Please reinstall the libcurl distribution -        easy.h should be in 
/include/curl/ # solve sudo curl -O http://curl.haxx.se/download/curl-7.46.0.tar.gz sudo tar -zxvf curl-7.46.0.tar.gz cd curl-7.46.0/ sudo ./configure --prefix=/usr/local/curl sudo make sudo make install
configure: error: jpeglib.h not found.
# err    checking whether to enable JIS-mapped Japanese font support in GD... no    If configure fails try --with-webp-dir=
configure: error: jpeglib.h not found. # solve sudo curl -O http://www.ijg.org/files/jpegsrc.v9a.tar.gz sudo tar -axvf jpegsrc.v9a.tar.gz cd jpeg-9a/ sudo ./configure --prefix=/usr/local/jpeg sudo make sudo make install
configure: error: png.h not found.
# err    checking for jpeg_read_header in -ljpeg... yes    configure: error: png.h not found.        # solve    sudo wget http://download.sourceforge.net/libpng/libpng-1.6.19.tar.gz    sudo tar -zxvf libpng-1.6.19.tar.gz    sudo ./configure --prefix=/usr/local/png    sudo make    sudo make install
stdin: not in gzip format
# err    sudo curl -O http://download.sourceforge.net/libpng/libpng-1.6.19.tar.gz    sudo tar -zxvf libpng-1.6.19.tar.gz        checking for j    gzip: stdin: not in gzip format    tar: Child returned status 1    tar: Error is not recoverable: exiting now        # solve    sudo wget http://download.sourceforge.net/libpng/libpng-1.6.19.tar.gz
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
# err    sudo ./configure --prefix=/usr/local/libmcrypt    checking for mcrypt support... yes    configure: error: mcrypt.h not found. Please reinstall libmcrypt.        # solve    sudo wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz    sudo tar -zxvf libmcrypt-2.5.7.tar.gz    cd libmcrypt-2.5.7/    sudo ./configure --prefix=/usr/local/libmcrypt    sudo make    sudo make install
unrecognized options: --with-mysql
# err    configure: WARNING: unrecognized options: --with-mysql        # solve    PHP7不支持mysql扩展[不允许该参数参与编译--with-mysql]
查看PHP版本信息,入看到类似下图信息表明PHP7已经编译安装成功

输入图片说明

转载于:https://my.oschina.net/bibyzhang/blog/541015

你可能感兴趣的文章
什么是Solr
查看>>
poj2386(简单dfs)
查看>>
双链表的基本操作
查看>>
走进异步编程的世界 - 剖析异步方法(上)
查看>>
[HAOI2006]受欢迎的牛
查看>>
docker-maven-plugin 完全免Dockerfile 文件
查看>>
day20 Python 装饰器
查看>>
限制性与非限制性定语从句区别
查看>>
fiddler工具的使用
查看>>
jquery源码分析(二)——架构设计
查看>>
javascript深入理解js闭包(转)
查看>>
207. Course Schedule
查看>>
如何优化您的 Android 应用 (Go 版)
查看>>
Trie树实现
查看>>
Opencv无法调用cvCaptureFromCAM无法打开电脑自带摄像头
查看>>
Exception异常处理机制
查看>>
复杂的web---web中B/S网络架构
查看>>
编写文档的时候各种问题
查看>>
Eclipse里maven的project报Unbound classpath variable: 'M2_REPO/**/***/***.jar
查看>>
新旅程CSS 基础篇分享一
查看>>