Laravel composer install 缺少phpfile_info,LNMP安装PHP fileinfo扩展模块 - Go语言中文社区

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

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_36602939/article/details/87382844
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-03-01 18:16:18
  • 阅读 ( 1017 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢