linux 安装php 全过程

1 . 先安装如下依赖包

yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel 	ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel 	openldap openldap-devel nss_ldap openldap-clients openldap-servers

2 . 下载php压缩包

wget http://cn2.php.net/distributions/php-7.4.4.tar.gz

3 . 解压

tar -zxvf php-7.4.4.tar.gz

 4 .  进入解压后的目录并配置

cd php-7.4.4

./configure --prefix=/usr/local/lnmp/php74 --with-config-file-path=/usr/local/lnmp/php74 --enable-mbstring --with-openssl --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pear --enable-sockets --with-freetype-dir=/usr --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-zip --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib --with-iconv --enable-zip --with-freetype-dir=/usr/lib/ --enable-soap --enable-pcntl --enable-cli --with-curl

注意:

--prefix=安装目录
--with-使用包名称[=包目录]
--enable-需要激活的功能

5 . 编译过程中遇到问题

    linux 安装 php No package 'sqlite3' found

 yum install sqlite-devel

    linux 安装 php No package 'oniguruma' found  [ php7.4 ]

    

yum install oniguruma oniguruma-devel

6 . 编译安装

make && make install

相关命令

启动php-fpm服务
/usr/local/php5/sbin/php-fpm
重启
service php-fpm restart

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值