Laravel composer install 缺少phpfile_info,LNMP安装PHP fileinfo扩展模块

# 安装composer

这里不解释了

# 执行

 

 Problem 1
    - Installation request for league/flysystem 1.0.50 -> satisfiable by league/flysystem[1.0.50].
    - league/flysystem 1.0.50 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
  Problem 2
    - league/flysystem 1.0.50 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - laravel/framework v5.7.26 requires league/flysystem ^1.0.8 -> satisfiable by league/flysystem[1.0.50].
    - Installation request for laravel/framework v5.7.26 -> satisfiable by laravel/framework[v5.7.26].

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/php/etc/php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

 

解决:

安装PHP程序的时候,提示The fileinfo extension is required.,缺少fileinfo 扩展,因为LNmpA没有自行开启,所以需要我们手工去开启fileinfo 扩展。

 

方法如下
第一步:找到llnmp安装源位置:

cd /lnmp1.5/src/php-5.6.9/ext/fileinfo/

 (如果php包没解压,那就解压)

第二步:

/usr/local/php/bin/phpize


返回类似下面的信息:

Configuring for:

PHP Api Version:         20131106

Zend Module Api No:      20131226

Zend Extension Api No:   220131226


phpize是什么东西呢?
php官方的说明:http://php.net/manual/en/install.pecl.phpize.php
phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块,比如你想在原来编译好的php中加入memcached或者ImageMagick等扩展模块,可以使用phpize。

 

第三步:

./configure --with-php-config=/usr/local/php/bin/php-config
make && make install


返回类似下面信息:

Build complete.

Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/


表明安装成功了。

 

第四步:
/usr/local/php/etc/php.ini 添加扩展:

extension=fileinfo.so

/etc/init.d/php-fpm restart


#然后重新执行composer

composer install


 

OK,成功


#composer install 报错总结:

  [ErrorException]                                         
  proc_get_status() has been disabled for security reasons

#解决:

[root@minion1 attendize]# grep proc_get_status /usr/local/php/etc/php.ini
disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server

找到proc_get_status删除,重启php

/etc/init.d/php-fpm restart

 

记得 make test

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值