繁体   English   中英

无法安装 PHPSpreadsheet

[英]Can't install the PHPSpreadsheet

我尝试安装 phpspreadysheet 但出现这些错误

Installation failed, deleting ./composer.json.


  [RuntimeException]
  No composer.json present in the current directory (./composer.json), this may   
  be the cause of the following exception.
                                                                                   


  [InvalidArgumentException]
  Package phpoffice/phpspreadsheet has requirements incompatible with your PHP v   
  ersion, PHP extensions and Composer version:                                     
    - phpoffice/phpspreadsheet 1.22.0 requires ext-fileinfo * but it is not pres   
  ent.                                                                             
    - phpoffice/phpspreadsheet 1.22.0 requires ext-gd * but it is not present.

有谁知道如何解决这一问题? 我被这些错误困扰了两天,找不到解决方案。 谢谢

打开 php.ini,搜索并取消注释以下

  1. 扩展=gd
  2. 扩展名=文件信息

在 Visual Studio 中打开您的项目,然后单击 ctr+shift+ ` 打开终端或打开 cmd 并进入您的项目目录

并粘贴下面的代码

composer require phpoffice/phpspreadsheet --ignore-platform-req=ext-gd

上面的语法对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM