在CentOS7上源码安装php7--Install php7 from source on CentOS7
首先下载php源码包并解压:
# wget http://cn2.php.net/get/php-7.0.9.tar.gz/from/this/mirror
# tar -xvf php-7.0..tar.gz
# cd php-7.0.
然后开始./configrue
./configure --enable-fpm --with-mysql
这里我只包含了 PHP-FPM 和 MySQL 支持的简单配置, 可以通过运行 ./configure --help 命令来获得完整的可用选项清单
configure过程中可能会出现的问题:
1. configure: error: xml2-config not found. Please check your libxml2 installation.
解决办法:
# rpm -qa|grep libxml2
libxml2-python-2.9.-.el7_1..x86_64
libxml2-2.9.-.el7_1..x86_64
没有libxml2-devel
yum install libxml2-devel
问题解决!
configure完成后
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
config.status: creating php7.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands
继续安装
make && make install
经过“漫长”的等待后,编译完成
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-/
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/php/man/man1/
Installing phpdbg binary: /usr/local/bin/
Installing phpdbg man page: /usr/local/php/man/man1/
Installing PHP CGI binary: /usr/local/bin/
Installing PHP CGI man page: /usr/local/php/man/man1/
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php/man/man1/
page: phpize.
page: php-config.
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - installed: 1.4.
[PEAR] Console_Getopt - installed: 1.4.
[PEAR] Structures_Graph- installed: 1.1.
[PEAR] XML_Util - installed: 1.3.
[PEAR] PEAR - installed: 1.10.
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
/root/php-7.0./build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f phar.phar /usr/local/bin/phar
Installing PDO headers: /usr/local/include/php/ext/pdo/
到这里,PHP已经安装成功了。
关于如何配置PHP,请参考PHP的官方文档。
Nginx+PHP: http://php.net/manual/zh/install.unix.nginx.php
Nginx和PHP配置完成之后,创建测试文件:
echo "<?php phpinfo(); ?>" >> /usr/local/nginx/html/index.php
访问http://localhost/index.php,如果可以将phpinfo打印到屏幕上,就证明 Nginx 和 PHP 配置正确。
如果您觉得阅读本文对您有帮助,欢迎转载本文,但是转载文章之后必须在文章页面明显位置保留此段声明,否则保留追究法律责任的权利。
作 者:blog.jpdou.top
在CentOS7上源码安装php7--Install php7 from source on CentOS7的更多相关文章
- 国产化设备鲲鹏CentOS7上源码安装Python3.7
具体编译过成与正常的Python源代码在x86平台上的过程无异,此篇随笔仅当用作复制黏贴的备忘录.不得不说在一个老旧系统上安装一个老旧的Python版本,从头编译一个Python还是一个较为稳健的选择 ...
- centos7上源码安装mysql5.7.11
由于初学,安装这玩意搞了三天,其间各种报错难以解决,网上各种解答误导.最好的办法还是使用官方的英文文档,建议初学者一定要使用官方的文档,特别是下面两个页面作为初学者一定要细看: Installing ...
- 在CentOS7上源码安装OpenResty
您必须将这些库perl 5.6.1+libreadlinelibpcrelibssl安装在您的电脑之中. 对于 Linux来说, 您需要确认使用 ldconfig 命令,让其在您的系统环境路径中能找到 ...
- CentOS7 实战源码安装mysql5.7.17数据库服务器
CentOS7 实战源码安装mysql5.7.17数据库服务器 简介:实战演练mysql数据库服务器的搭建 mysql简介: mysql是一个开源的关系型数据库管理系统,现在是oracle公司旗下的 ...
- [原创]在Centos7.2上源码安装PHP、Nginx、Zentao禅道
版本 操作系统:CentOS Linux release 7.2.1511 (Core) PHP:5.6.33 Nginx:1.12.2 MySQL:5.6.38(192.168.1.103的Wind ...
- CentOS7下源码安装mysql5.6
目录 准备工作 运行环境 确认你的安装版本 下载mysql 安装mysql 准备安装环境 编译和安装 配置mysql 单实例配置 单实例配置方法 添加防火墙 ...
- CentOS7下源码安装5.6.23
清理CentOS7下的MariaDB. [root@localhost ~]#rpm -qa | gremp mariadb [root@localhost ~]# rpm -e --node ...
- centos7 中源码安装nginx
使用nginx有一段时间了,还是有很多东西不懂的,在这里做一下自己学习过程中的一些整理,能使自己得到提升. 1.环境:centos7 1511 最小化安装 2.下载nginx,可以在系统中下载,也可 ...
- Centos6.6上源码安装Nodejs V4版本
本来就是想在vps上装一个Ghost博客,这个博客依赖的是Nodejs,然后推荐的是V4版本.然后我就对着官网的步骤安装,发现根本没有Centos6 i386的资源了(64位的还是有的), 我只能在那 ...
随机推荐
- MSTAR GAMMA
1.读取系统GAMMA值 2.在此基础上微调 3.导出Gamma.txt->导入系统.“Gamma12BIT_256.c”或者“Gamma12BIT_1024.c”. Read 微调&写 ...
- S5pv210 HDMI 接口在 Linux 3.0.8 驱动框架解析
作者:liukun321 咕唧咕唧 日期:2014.1.18 转载请标明作者.出处:http://blog.csdn.net/liukun321/article/details/18452663 本文 ...
- Oracle 表连接方式(1)---
Oracle 表之间的连接分为三种: 1. 内连接(自然连接) 2. 外连接 (1)左外连接 (左边的表不加限制) (2)右外连接(右边的表不加限制) (3)全外连接(左右两表都不加限制) 3. 自连 ...
- [bzoj2154]Crash的数字表格(mobius反演)
题意:$\sum\limits_{i = 1}^n {\sum\limits_{j = 1}^m {lcm(i,j)} } $ 解题关键: $\sum\limits_{i = 1}^n {\sum\l ...
- [hdu2586]How far away?(LCA)
题意:问树上两点之间的最短距离 解题关键:LCA模板题,在线做法,LCA->RMQ,用st表求解 这里是用first,rmq数组长度可以减半. #include<cstdio> #i ...
- C# 随机列表
一.问题描述 在EF中使用随机排序出现的问题:LINQ to Entities does not recognize the method 'System.Guid NewId()' method, ...
- Linux+ant+jmeter+Jenkins接口持续集成自动化框架搭建
Linux下安装ant并配置环境变量 1.从http://ant.apache.org 上下载tar.gz版ant 2.复制到/usr下 3.tar -vxzf apache-ant-1.10.1-b ...
- C++ STL vector使用总结
vector是C++标准模板库中的部分内容,它是一个多功能的,能够操作多种数据结构和算法的模板类和函数库.vector之所以被认为是一个容器,是因为它能够像容器一样存放各种类型的对象,简单地说vect ...
- git从远程仓库gitLab上拉取指定分支到本地仓库
例如:将gitLab 上的dev分支拉取到本地 1>与远程仓库建立连接:git remote add origin XXXXX.git 2>使用git branch 查看本地是否具有dev ...
- LOL数值分析
http://blog.sina.com.cn/s/blog_704133cb01018hud.html 为了从理论层面提高自己打<英雄联盟>的水平,再加上自己也有这方面的兴趣,所以我最近 ...