php7.4.x的源码安装-(shell15)

本文档介绍了如何通过shell脚本源码安装PHP7.4.x,过程中可能遇到依赖库版本过低的问题。详细步骤包括安装libgd、cmake3.0x、libzip、freetype、pcre2、libxml2和openssl等,并通过设置PKG_CONFIG_PATH环境变量确保编译环境。特别提示,pcre2、oniguruma和libgd应在一开始就安装,后续根据实际需求添加其他依赖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 shell的脚本

#!/bin/bash
HOME="/home"
PHP_INSTALL_DIR="/usr/local"
PHP_INSTALL="php7410"
PHP_FLOD="php-7.4.10"
PHP_TAR="$PHP_FLOD.tar.gz"
PHP_URL="http://mirrors.sohu.com/php/$PHP_TAR"
# gd-devel要大于2.1
#创建用户及用户组方法
function createUserGroupAndUser() {
    group=$1
    user=$2
    egrep "^$group" /etc/group >&/dev/null
    #创建用户组
    if [[ $? -ne 0 ]]; then
        groupadd $group
    fi
    #创建用户组下面的用户
    egrep "^$user" /etc/passwd >&/dev/null
    if [ $? -ne 0 ]; then
        useradd -r -s /sbin/nologin -g $group $user
    fi
}
function installPHP() {
    #yum安装依赖的包
    rpm -q yum &>/dev/null
    if [ $? -ne
# LAMP Auto Install Script for CentOS 7 #centos7下编写自动化脚本搭建lamp架构,下载目录为/opt/lamp1/,需求版本:apache-2.4.63、php-7.4.33、mysql-8.0.41-1.el9.x86_64.rpm-bundle.tar,php不用单独启动,和apache联动即可 #要求: #目前线上apache使用的模块为(core_module, authn_file_module, authn_default_module, authz_host_module, authz_groupfile_module, authz_user_module, authz_default_module, auth_basic_module, include_module, filter_module, log_config_module, env_module, setenvif_module, version_module, mpm_prefork_module, http_module, mime_module, status_module, autoindex_module, asis_module, cgi_module, negotiation_module, dir_module, actions_module, userdir_module, alias_module, rewrite_module, so_module, ssl_module (shared), xsendfile_module (shared), php5_module (shared)) #目前线上php使用的模块为(bcmath,bz2,Core,ctype,curl,date,dom,ereg,fileinfo,filter,gd,gettext,hash,iconv,json,libxml,mbstring,mcrypt,mhash,mysql,mysqli,mysqlnd,openssl,pcntl,pcre,PDO,pdo_mysql,pdo_sqlite,Phar,posix,Reflection,session,shmop,SimpleXML,soap,sockets,SPL,sqlite3,standard,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,zip,zlib) #安装apache和php的依赖模块apr-1.7.5、apr-util-1.6.3、ibiconv-1.15、libmcrypt-2.5.8、mhash-0.9.9.9、mcrypt-2.6.8、libmcrypt-devel并做好环境变量和软连接 #保留以上模块前提下,apache、php的模块全部启用并加载,并解决依赖关系 #验证apache和php联动性、访问,MySQL登录和初始化、密码设置为1hblsqt2zhlmcl#@!
最新发布
03-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yll1024335892

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值