简体   繁体   中英

Can't install the PHPSpreadsheet

I try to install the phpspreadysheet but these error occurs

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.

Does anyone know how to fix this? I am stuck with these errors for two days and could not find the solution. Thank you

open php.ini, search and uncomment following

  1. extension=gd
  2. extension=fileinfo

Open your project in visual studio and click ctr+shift+ ` to open terminal or open cmd and to your project directory

and paste below code

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

Above syntax worked form me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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