• 编译安装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 
    
  • 相关阅读:
    Poj2033
    CodeForces 540
    CodeForces 548
    LeetCode#2 Add Two Numbers
    CodeForces 544A
    POJ 2431Expedition
    HLG1116-选美大赛
    清华学堂 列车调度(Train)
    清华学堂 LightHouse
    清华学堂 Range
  • 原文地址:https://www.cnblogs.com/wuvikr/p/13961296.html
Copyright © 2020-2023  润新知