编译安装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 ...
随机推荐
- HCNP Routing&Switching之MAC安全
前文我们了解了GRE over IPSec 相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/16601491.html:今天我们来聊一聊mac安全相关话 ...
- ARC116 A Odd vs Even (质因数分解,结论)
题面 有 T T T 组数据,每次给出一个数 N N N ,问 N N N 的所有因数(包括 1 1 1 和 N N N)中奇因数个数和偶因数个数的关系(">"," ...
- Navicat破解版下载安装
不要再去搜索尝试其他人的破解方式,真是浪费时间!!!网上的所谓"Navicat Premium 15 破解补丁",使用version.dll等破解的亲测不可用,还有一种使用&quo ...
- FR801xH开发
一.空间分配 二.代码流程 1)user_custom_parameters 函数 __jump_table 结构体中保存了一些配置信息: void user_custom_parameters(vo ...
- KingbaseES时间函数的比较
KingbaseES提供了多种的时间函数,这些函数在使用过程中存在哪些不同? **同一事务** test=# begin test-# for i in 1.. 10 loop test-# rais ...
- Qt5.14.2使用虚拟键盘
说明 这是关于Qt5(Qt5.1.4.2),QWidget编程使用Qt虚拟键盘(qtvirtualkeyboard) Tag: QT5,Qt,软件盘.虚拟键盘,Widget程序,QML 作者:474 ...
- Gitea 1.17.1 正式发布 | 08 累积更新
Gitea 1.17.1 已正式发布.在这个小的版本更新中我们合并了 35 个 PR,没有包含功能性的更改,但我们强烈建议用户升级到此版本以获得重要的修复补丁. 致谢:感谢报告问题的安全研究人员,同时 ...
- 使用读写分离模式扩展 Grafana Loki
转载自:https://mp.weixin.qq.com/s?__biz=MzU4MjQ0MTU4Ng==&mid=2247500127&idx=1&sn=995987d558 ...
- kubernetes给容器生命周期设置操作事件
Kubernetes支持预启动和预结束事件. Kubernetes在容器启动的时候发送预启动事件,在容器结束的时候发送预结束事件. 定义预启动和预结束事件操作 下面是Pod的配置文件: # cat l ...
- NSIS皮肤插件:vcl-styles-plugins
vcl-styles-plugins简介 NSISVCLStyles plugin (dll)是一款应用于nsis安装程序的皮肤插件,插件大小约为1.6MB,实际应用在安装程序中压缩后约为550 ...