Ubuntu 16.04 源码编译安装PHP7

一、下载PHP7的最新版源码

php7.0.9  下载地址 http://php.net/get/php-7.0.9.tar.gz/from/a/mirror

二、解压

tar -zxf /tmp/php-7.0.9.tar.gz

三、安装相关依赖库

sudo apt-get update
sudo apt-get install libxml2-dev
#安装gcc
sudo apt-get install build-essential
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install make
sudo apt-get install curl
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libpng-dev
sudo apt-get install libmcrypt-dev
sudo apt-get install libreadline6 libreadline6-dev

四、编译:(编译参数2个中选择一个,第一段大部分机器即可编译,第二段参数推荐64位x86系统编译)

cd /tmp/php-7.0.9
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
cd /tmp/php-7.0.9
./configure --prefix=/usr/local/php --enable-fpm --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --with-mysql --with-mysqli --with-mysql-sock --enable-pdo --with-pdo-mysql --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --enable-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear --with-libdir=/lib/x86_64-linux-gnu --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --enable-xml

五、执行make 和 sudo make install 安装

make && sudo make install

六、配置php-fpm

cd /usr/local/php/etc

cp php-fpm.conf.default php-fpm.conf

cd /usr/local/php/etc/php-fpm.d

cp www.conf.default www.conf

user = www
group = www

如果www用户不存在,那么先添加www用户
groupadd www
useradd -g www www

七、验证PHP

/usr/local/php/bin/php -v

八、启动php-fpm

sudo /usr/local/php/sbin/php-fpm
时间: 2024-12-26 07:55:53

Ubuntu 16.04 源码编译安装PHP7的相关文章

[环境配置]Ubuntu 16.04 源码编译安装OpenCV-3.2.0+OpenCV_contrib-3.2.0及产生的问题

1.OpenCV-3.2.0+OpenCV_contrib-3.2.0编译安装过程 1)下载官方要求的依赖包 GCC 4.4.x or later CMake 2.6 or higher Git GTK+2.x or higher, including headers (libgtk2.0-dev) # 控制opencv GUI pkg-config Python 2.6 or later and Numpy 1.5 or later with developer packages (pytho

ubuntu 16.04源码编译和配置caffe详细教程 | Install and Configure Caffe on ubuntu 16.04

本文首发于个人博客https://kezunlin.me/post/b90033a9/,欢迎阅读! Install and Configure Caffe on ubuntu 16.04 Series Part 1: Install and Configure Caffe on windows 10 Part 2: Install and Configure Caffe on ubuntu 16.04 Guide requirements: NVIDIA driver 396.54 CUDA 8

[Part 3] 在Ubuntu 16.04源码编译PCL 1.8.1支持VTK和QT

本文首发于个人博客https://kezunlin.me/post/137aa5fc/,欢迎阅读! Part-3: Install and Configure PCL 1.8.1 with vtk qt support on Ubuntu 16.04 from source Series Part-1: Install and Configure Qt5 on Ubuntu 16.04 Part-2: Install and Configure VTK 8.1.0 from source wit

源码编译安装PHP7

Linux软件源码安装常用步骤 wget下载压缩包 解压并进入源码目录 ./configure 运行配置 添加配置常数(./configure --help) make 编译 make install 安装 源码编译安装PHP 下载安装包 wget http://am1.php.net/get/php-7.2.4.tar.gz wget [参数] [URL] wget 指令介绍 解压安装包并进入源码目录 tar -zxvf php-7.2.4.tar.gz cd php-7.2.4 tar 指令

ubuntu 14.04 源码编译postgresql

环境 ubuntu 14.04 桌面版 postgresql 源码下载链接,本教程是使用postgresql 9.3.4 进行编译的 http://www.postgresql.org/ftp/source/ 首先我们需要给ubuntu 安装几个包,因为 postgresql 编译时依赖 install libreadline > apt-get install libreadline6 libreadline6-dev install zlib > apt-get install zlib1

Centos6.8源码编译安装PHP7

一.下载源码包 打开php官网http://php.net/点击导航栏的Downloads进入下载页面:http://php.net/downloads.php下载想要安装的版本,这里下载最新版的php-7.1.8 的源码包. 下载环境源码包wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz   可以选择版本,这里下载最新版libiconv-1.15.tar.gz 二.解压源码包并安装环境包 1 tar zxvf libi

源码编译安装php7.0.5

源码包下载地址 http://219.239.26.3/files/4255000007F687B2/cn2.php.net/distributions/php-7.0.5.tar.gz 安装epel扩展yum源 [[email protected] ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm [[email protected] ~]# yum clean all

CentOS7源码编译安装PHP7.2

一.环境 CentOS7 二.相关资源 PHP官方网站 PHP官方下载页 三.编译安装 1. 下载php 下载并解压 # 下载php wget https://www.php.net/distributions/php-7.2.16.tar.gz # 解压 tar -zxvf php-7.2.16.tar.gz 查看目录 [[email protected] ~]# ll 总用量 19232 drwxrwxr-x 14 root root 4096 3月 5 19:05 php-7.2.16 -

Ubuntu14.04 源码编译安装ejabberd15.04

一.环境 1.系统:Ubuntu14.04_x64 二.下载 1. yaml-0.1.5:链接: http://pan.baidu.com/s/1sj8zGg1 密码: c8ah 2. expat-2.1.0:链接: http://pan.baidu.com/s/1qWE7zmk 密码: 484h 3. libiconv-1.14:链接: http://pan.baidu.com/s/1i3zmBdz 密码: jie2 4.otp_src_17.5:链接: http://pan.baidu.co