zoukankan      html  css  js  c++  java
  • centos7环境安装php fileinfo扩展

    场景:centos7安装通过composer安装laravel的时候,提示要装fileinfo扩展,用宝塔安装的php7.3是没有装 fileinfo扩展的。

    根据手册的介绍fileinfo扩展从php5.3之后默认是开启的,所以不需要我们单独安装。但是有的集成环境为了编译php的时候提高速度或者节省资源就去掉了这个扩展的安装。所以就需要我们自己动手来安装了。

      我们从fileinfo的源码来安装这个扩展。fileinfo的源码在php源码的“src/ext/fileinfo”的目录下面,可以用find来找到具体的路径

    find / -name fileinfo

      

      找到路径之后进入到fileinfo目录中。

      开始扩展的安装:

      1. phpize

      执行phpize命令

      2. ./configure --with-php-config=/usr/local/php/bin/php-config

      执行configure配置。

      如果提示php-config命令不存在 configure: error: Cannot find php-config. Please use --with-php-config=PATH

      

      可以执行yum install php-devel, 安装php-devel,安装完成之后再执行这条命令即可。

      3. make && make install

      编译安装

      4. 修改php.ini文件,添加extension=fileinfo.so

      到此为止就安装成功了。

    参考地址:https://www.cnblogs.com/guansixu/p/7058295.html

  • 相关阅读:
    XMU1349 xmu_1349
    字符串排序
    linux磁盘文件与目录管理系统(2)
    poj 3667 Hotel
    poj 3468 A Simple Problem with Integers
    linux文与目录管理
    Linux的磁盘与文件管理系统(1)
    hdu 1698 Just a Hook
    poj3225 Help with Intervals
    poj 2886Who Gets the Most Candies?
  • 原文地址:https://www.cnblogs.com/lmp5023/p/14097411.html
Copyright © 2011-2022 走看看