当前位置:   article > 正文

PHP7源码编译安装

configure: warning: unrecognized options: --with-webp-dir

源码编译安装

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

输入图片说明

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/456343
推荐阅读
相关标签
  

闽ICP备14008679号