I'm spiderman I'm spiderman
首页
  • 中间件
  • 基础架构
  • 微服务
  • 云原生
  • Java
  • Go
  • PHP
  • Python
  • 计算机网络
  • 操作系统
  • 数据结构
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
关于
  • 分类
  • 标签
  • 归档

spiderman

快乐学习,快乐编程
首页
  • 中间件
  • 基础架构
  • 微服务
  • 云原生
  • Java
  • Go
  • PHP
  • Python
  • 计算机网络
  • 操作系统
  • 数据结构
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
关于
  • 分类
  • 标签
  • 归档
  • Java

  • Golang

  • PHP

    • 安装php环境
      • 安装composer
      • PHP7的性能优化
    • Python

    • 计算机语言
    • PHP
    spiderman
    2023-05-02
    目录

    安装php环境

    # 先安装依赖

    yum install libxml2-devel sqlite-devel libcurl-devel oniguruma-devel libpng-devel libjpeg-devel freetype-devel libzip-devel openssl-devel -y
    
    1

    # 下载源码和安装

    wget https://www.php.net/distributions/php-7.4.33.tar.gz
    tar -zxvf php-7.4.33.tar.gz
    cd php-7.4.33
    ./configure --prefix=/data/php --with-config-file-path=/data/php/etc --with-mysqli=mysqlnd  --with-pdo-mysql=mysqlnd --with-iconv-dir --with-curl --with-zlib --without-pear --with-gettext --with-mhash --enable-xml  --enable-bcmath --enable-soap --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-pdo --enable-shmop --enable-sysvsem --enable-sockets --enable-inline-optimization --enable-maintainer-zts --enable-mbregex --enable-mbstring --enable-pcntl --disable-fileinfo --disable-rpath --enable-opcache
    make
    make install
    cp php.ini-development /data/php/etc/php.ini
    cp php-fpm.conf.default /data/php/php-fpm.conf
    ln -s /data/php/bin/ /usr/bin/
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    # 安装pdo_mysql扩展

    #安装依赖包
    yum install m4
    yum install autoconf
    
    #进入对应版本的php安装包的ext/pdo_mysql目录,如下
    cd /data/php/php-7.4.33/ext/pdo_mysql
    
    #在ext/pdo_mysql目录执行phpize
    /data/php/bin/phpize
    
    #执行configure,其中:
    #--with-pdo-mysql为mysql的安装路径
    ./configure --with-php-config=/data/php/bin/php-config --with-pdo-mysql=/data/mysql/
    
    #编译安装
    make && make install
    
    #编辑php.ini文件,把extension=pdo_mysql前面的分号去掉,重启PHP服务
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18

    # 安装curl扩展

    cd /data/php/php-7.4.33/ext/curl
    /data/php/bin/phpize
    ./configure --with-php-config=/data/php/bin/php-config
    make
    make install
    
    1
    2
    3
    4
    5

    # 安装openssl扩展

    cd /data/php/php-7.4.33/ext/openssl
    /data/php/bin/phpize
    ./configure --with-php-config=/data/php/bin/php-config
    make
    make install
    
    1
    2
    3
    4
    5

    # 安装swoole

    cd /data/php/php-7.4.33/ext/
    # swoole安装包地址:http://pecl.php.net/package/swoole
    wget http://pecl.php.net/get/swoole-4.8.7.tgz
    tar -zxvf swoole-4.8.7.tgz
    mv swoole-4.8.7 swoole
    /data/php/bin/phpize
    ./configure --with-php-config=/data/php/bin/php-config
    make
    make install
    vim /data/php/etc/php.ini
    extension=swoole
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    # 启动php-fpm

    cp /data/php/php-7.4.33/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
    chmod +x /etc/init.d/php-fpm
    chkconfig --add php-fpm
    chkconfig php-fpm on
    systemctl enable php-fpm.service  
    /usr/lib/systemd/systemd-sysv-install enable php-fpm
    systemctl status php-fpm.service
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    golang调度原理
    安装composer

    ← golang调度原理 安装composer→

    最近更新
    01
    innovation create future
    12-13
    02
    RabbitMQ
    12-06
    03
    StarRocks的应用
    09-11
    更多文章>
    Theme by Vdoing | Copyright © 2022-2024 spiderman | 粤ICP备2023019992号-1 | MIT License
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式