zoukankan      html  css  js  c++  java
  • 编译安装php7.4.12(fscgi模式)

    #安装相关包
    [root@tencent-centos7 ~]#yum -y install gcc libxml2-devel bzip2-devel libmcrypt-devel sqlite-devel oniguruma-devel
    
    
    #编译
    [root@tencent-centos7 ~]#tar xvf php-7.4.12.tar.bz2
    [root@tencent-centos7 ~]#cd php-7.4.12
    
    [root@tencent-centos7 php-7.4.12]#./configure 
    --prefix=/apps/php74 
    --enable-mysqlnd 
    --with-mysqli=mysqlnd 
    --with-pdo-mysql=mysqlnd 
    --with-openssl 
    --with-zlib 
    --with-config-file-path=/etc 
    --with-config-file-scan-dir=/etc/php.d 
    --enable-mbstring 
    --enable-xml 
    --enable-sockets 
    --enable-fpm 
    --enable-maintainer-zts 
    --disable-fileinfo
    
    [root@tencent-centos7 php-7.4.12]#make -j 8 && make install
    
    #准备PATH变量
    [root@tencent-centos7 php-7.4.12]#echo 'PATH=/apps/php74/bin:$PATH' > /etc/profile.d/php.sh
    [root@tencent-centos7 php-7.4.12]#. /etc/profile.d/php.sh
    
    # 查看版本信息,确认安装成功
    [root@tencent-centos7 php-7.4.12]#php --version
    PHP 7.4.12 (cli) (built: Nov 11 2020 21:36:08) ( ZTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
    
    
    #准备php配置文件和启动文件
    [root@tencent-centos7 php-7.4.12]#cp php.ini-production /etc/php.ini
    [root@tencent-centos7 php-7.4.12]#cp sapi/fpm/php-fpm.service /usr/lib/systemd/system/
    
    [root@tencent-centos7 php-7.4.12]#cd /apps/php74/etc
    [root@tencent-centos7 etc]#cp php-fpm.conf.default php-fpm.conf
    
    [root@tencent-centos7 etc]#cd php-fpm.d/
    [root@tencent-centos7 php-fpm.d]#cp www.conf.default www.conf
    
    
    # 修改php-fpm配置文件
    [root@tencent-centos7 php-fpm.d]#vim /apps/php74/etc/php-fpm.d/www.conf
    #修改进程所有者
    user apache
    group apache 
    #支持status和ping页面
    pm.status_path = /status
    ping.path = /ping  
    
    
    #开启opcache加速
    [root@tencent-centos7 php-fpm.d]#mkdir /etc/php.d/
    [root@tencent-centos7 php-fpm.d]#vim /etc/php.d/opcache.ini
    [opcache]
    zend_extension=opcache.so               
    opcache.enable=1
    
    [root@tencent-centos7 php-fpm.d]#systemctl daemon-reload
    [root@tencent-centos7 php-fpm.d]#systemctl enable --now php-fpm.service 
    
  • 相关阅读:
    Windows Server 2003中不能安装MSN的解决方法
    招新人的一个标准
    SVN源代码服务器 证书通不过时的解决办法
    项目风险控制
    项目与团队管理体会
    季羡林老先生百年为人处世哲学
    李一男2003年在港湾给开发人员培训时的语录
    项目管理中的一些想法
    poj 1236 Network of Schools
    poj 2528 Mayor's posters
  • 原文地址:https://www.cnblogs.com/wuvikr/p/13961296.html
Copyright © 2011-2022 走看看