银河麒麟V10离线搭建PHP环境

最近在做国产化的项目。要求使用银河麒麟V10操作系统。在内网下搭建PHP的环境踩了很多坑。非常痛苦。在此记录下。

注意、注意、注意。不管是内网搭建还是外网搭建环境。都最好不要使用非官方的软件源。同样如果内网需要一些依赖包。最好也在官网的软件源去下载。别随意去其他软件源下载使用。如果官网软件源没有你想要的依赖包,那就最好联系麒麟的工程师。否则服务器容易出现问题。这是血的教训!!!

首先要确定服务器是银河麒麟V10是什么CPU版本。下载对应版本的镜像文件。

  1. 挂载镜像文件到服务器上面。操作方法和centos挂载镜像一样。如:mount -t iso9660 /mnt/iso/CentOS-7-x86_64-DVD-1810.iso /opt/centos
  2. 将挂载的镜像文件做为软件源地址。挂载完后记得更新缓存。
  3. 安装PHP所需要的扩展(根据自己的需求来安装):
yum install libxml2 | yum install libxml2-devel |  yum install openssl openssl-devel | yum install libcurl-devel | yum install libpng-devel | yum install freetype freetype-devel | yum -y install libxslt-devel | yum install bzip2 bzip2-devel | yum install gcc gcc-c++
  1. 将下载的PHP安装包复制到/usr/local/src目录下并解压:sudo tar -zxvf php-7.2.23.tar.gz。下载地址百度PHP官网
  2. 进入到解压目录:cd php-7.2.23/
  3. 执行预编译注意自己目录 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl-dir=/usr/bin/curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
  4. 预编译完成执行安装:make && make install
  5. cp php.ini-development /usr/local/php/etc/php.ini
  6. 配置php-fpm命令:cd /usr/local/etc/ cp php-fpm.conf.default php-fpm.conf
  7. cd php-fpm.d cp www.conf.default www.conf
  8. groupadd www
  9. useradd -g www www
  10. 启动 php-fpm
  • 0
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Richai

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

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

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

打赏作者

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

抵扣说明:

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

余额充值