编译安装PHP7.4
1、下载PHP源码包
wget https://www.php.net/distributions/php-7.4.30.tar.gz
2、解压缩
tar xf php-7.4.30.tar.gz -C /usr/local/src
3、预编译、检查环境
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli --with-pdo-mysql --with-mysql-sock=/usr/local/mysql/mysql.sock --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-curl --with-gd --with-gmp --with-zlib --with-xmlrpc --with-openssl --without-pear --with-snmp --with-gettext --with-mhash --with-libxml-dir=/usr --with-ldap --with-ldap-sasl --with-fpm-user=nginx --with-fpm-group=nginx --enable-xml --enable-fpm --enable-ftp --enable-bcmath --enable-soap --enable-shmop --enable-sysvsem --enable-sockets --enable-inline-optimization --enable-maintainer-zts --enable-mbregex --enable-mbstring --enable-pcntl --enable-zip --disable-fileinfo --disable-rpath --enable-libxml --enable-opcache --enable-mysqlnd
出现的错误
configure: error: Package requirements (libxml-2.0 >= 2.7.6) were not met:
解决方法:
yum install libxml2-devel -y
configure: error: Package requirements (openssl >= 1.0.1) were not met:
解决方法:
yum install openssl-devel -y
configure: error: Package requirements (sqlite3 > 3.7.4) were not met:
解决方法:
yum install sqlite-devel -y
configure: error: Package requirements (libcurl >= 7.15.5) were not met:
解决方法:
yum install libcurl-devel -y
configure: error: GNU MP Library version 4.2 or greater required.
解决方法:
yum -y install gmp-devel -y
configure: error: Cannot find ldap.h
解决方法:
yum install openldap openldap-devel -y
configure: error: Cannot find ldap libraries in /usr/lib.
解决方法:
cp -frp /usr/lib64/libldap* /usr/lib/
configure: error: Package requirements (oniguruma) were not met:
解决方法:
yum install oniguruma-devel -y
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
解决方法:
yum install net-snmp-devel -y
4、编译并安装
make & make install
出现的错误
cc: fatal error: Killed signal terminated program cc1
compilation terminated.
解决方法:
mkdir -p /var/cache/swap/
dd if=/dev/zero of=/var/cache/swap/swap0 bs=10M count=400
chmod 0600 /var/cache/swap/swap0
mkswap /var/cache/swap/swap0
swapon /var/cache/swap/swap0
swapon -s
/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup'
//usr/lib64/liblber-2.4.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:287: sapi/cli/php] Error 1
解决方法:
vim Makefile
#在以EXTRA_LIBS开头的一行结尾添加‘-llber’,如下:
EXTRA_LIBS = -lcrypt -lresolv -lcrypt -lrt -lldap -lgmp -lrt -lm -ldl -lpthread -lxml2 -lssl -lcrypto -lsqlite3 -lz -lcurl -lxml2 -lssl -lcrypto -lonig -lsqlite3 -lxml2 -lnetsnmp -lm -lssl -lssl -lcrypto -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lxml2 -lz -lssl -lcrypto -lcrypt -llber
5、配置php配置文件
#移动php配置文件的位置,并修改名称
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.conf
#复制php.ini文件
cp /usr/local/src/php-7.4.30/php.ini-production /usr/local/php/etc/php.ini
6、复制php启动脚本到/etc/init.d/
cp /usr/local/src/php-7.4.30/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
systemctl enable php-fpm.service
/usr/lib/systemd/systemd-sysv-install enable php-fpm
systemctl status php-fpm.service
编译安装PHP7.4的更多相关文章
- 编译安装PHP7并安装Redis扩展Swoole扩展
编译安装PHP7并安装Redis扩展Swoole扩展 在编译php7的机器上已经有编译安装过php5.3以上的版本,从而依赖库都有了 本php7是编译成fpm-php 使用的, 如果是apache那么 ...
- 【安装PHP】如何在openSUSE42.1下编译安装PHP7
首先推荐一篇文章PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? - PHP Classes blog. 里面说到是否会去使用PHP7, ...
- 全志a20安卓电视盒子安装可道云kodexplorer服务-编译安装php7.3+nginx
可道云真的很强大,安装包很小,功能却很齐全,还可以自定义轻应用如果有手机客户端就更好了 研究了一下,可道云根目录放到外置存储设备(移动硬盘)会更合适,改路径的方法下面有提到上传文件时一个文件会在用户目 ...
- centos7.6编译安装php7.2.11及redis/memcached/rabbitmq/openssl/curl等常见扩展
centos7.6编译安装php7..11及redis/memcached/rabbitmq/openssl/curl等常见扩展 获取Php的编译参数方法: [root@eus-api-cms-bac ...
- centos7下编译安装php-7.0.15(PHP-FPM)
centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...
- 编译安装PHP7并安装Redis扩展Swoole扩展(未实验)
用PECL自动安装Redis扩展.Swoole扩展 pecl install redis pecl install swool 编译安装PHP7并安装Redis扩展Swoole扩展 在编译php7的机 ...
- CentOS编译安装php7.2
介绍: 久闻php7的速度以及性能那可是比php5系列的任何一版本都要快,具体性能有多好,建议还是先尝试下再说.如果你是升级或新安装,那你首先需要考虑php7和程序是否存在兼容性,如果程序是基于php ...
- CentOS7 编译安装 php7
更新:2019-01-25 补充:CentOS 7.5 全新编译安装 PHP-7.3.1 ,补充内容接在原文之后 更新:2018-09-29 补充:新系统下编译安装PHP-7.2.5遇到的问题,补充内 ...
- Linux Centos7.2 编译安装PHP7.0.2
操作环境: 1.系统:Centos7.2 2.服务:Nginx 1.下载PHP7.0.2的安装包解压,编译,安装: $ cd /usr/src/ $ wget http://cn2.php.net/d ...
- Centos7源码编译安装PHP7.2(生产环境)
安装PHP依赖包,否则在编译的过程中可能会出现各种报错 # Centos 安装epel-release源并将系统包更新到最新版本 $ yum install epel-release-y $ yum ...
随机推荐
- OpenStack-iaas之“先点”云平台安装
1.认识OpenStack 1.云计算的起源 早在2006年3月,亚马逊公司首先提出弹性计算云服务.2006年8月9日,谷歌公司首席执行官埃里克·施密特(Eric Schmidt)在谷歌搜索引擎大会( ...
- 根节点选择器和 html 选择器
CSS 中除了用标签选择器选中<html>标签以外还有一个等价的是:root选择器.CSS 变量是有作用域的,全局变量都可以声明在<html>里. <div class= ...
- 使用MindSpore计算旋转矩阵
技术背景 坐标变换.旋转矩阵,是在线性空间常用的操作,在分子动力学模拟领域有非常广泛的应用.比如在一个体系中切换坐标,或者对整体分子进行旋转平移等.如果直接使用Numpy,是很容易可以实现的,只要把相 ...
- 虚拟机kali端口映射外网vps
前言:我们常用的kali系统一般都是在虚拟机里面运行,这样在真实环境中外网是访问不到你的kali攻击机的,这时候我们就需要给kali映射一个外网vps. 一.在vps启动frp 服务端 安装frp并解 ...
- 持久化-DLL劫持
持久化-DLL劫持 原理 通过篡改.替换和代理原dll文件来达到劫持. 原理演示 假定演练流程 假定我们要劫持的目标是 c:\temp\legit.dll 获取 c:\temp\legit.dll 所 ...
- KingbaseES 数据库Windows环境下注册失败分析
关键字: KingbaseES.Java.Register.服务注册 一.安装前准备 1.1 软件环境要求 金仓数据库管理系统KingbaseES V8.0支持微软Windows 7.Windows ...
- picoCTF:keygenme-py 解题思路
keygenme-py 解题思路 题目如下 点击 keygenme-trial.py 获取要破解的文件 py文件代码为 点击查看代码 #================================ ...
- Filebeat Nginx Module 自定义字段
Filebeat Nginx Module 自定义字段 一.修改/usr/local/nginx/conf/nginx.conf中 log_format access '$remote_addr - ...
- 一个注解解决ShardingJdbc不支持复杂SQL
背景介绍 公司最近做分库分表业务,接入了 Sharding JDBC,接入完成后,回归测试时发现好几个 SQL 执行报错,关键这几个表都还不是分片表.报错如下: 这下糟了嘛.熟悉 Sharding J ...
- haodoop数据压缩
压缩概述 压缩技术能够有效减少底层存储系统(HDFS)读写字节数.压缩提高了网络宽带和磁盘空间的效率.在运行MR程序时,I/O操作,网络数据传输,Shuffle和Merge要花大量的时间,尤其是数据规 ...