0

I need to add QR features in my project so I found siple-qr Library, but when I run

composer require simplesoftwareio/simple-qrcode

it says

Using version ^4.2 for simplesoftwareio/simple-qrcode
./composer.json has been updated
Running composer update simplesoftwareio/simple-qrcode
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires simplesoftwareio/simple-qrcode ^4.2 -> satisfiable by 
simplesoftwareio/simple-qrcode[4.2.0].
    - simplesoftwareio/simple-qrcode 4.2.0 requires ext-gd * -> it is missing from your 
system. Install or enable PHP's gd extension.

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

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Osama Amr
  • 149
  • 1
  • 2
  • 13

3 Answers3

4

Open C:\xampp\php\php.ini and search for extension=gd. Remove the ; in front of the found line. Save the changes, restart XAMPP (not sure if necessary) and you're ready to go.

composer require simplesoftwareio/simple-qrcode

Sometimes it is necessary to change the extension_dir variable to extension_dir = "ext" on windows systems. Also in the C:\xampp\php\php.ini file.

iPaat
  • 792
  • 4
  • 16
0

this worked for me, edit the composer.json file.

"require": {
    ....
    "simplesoftwareio/simple-qrcode": "~4"
},

then run the following command in the console: composer update

0

this worked for me

composer require simplesoftwareio/simple-qrcode:4.2 --with-all-dependencies

first of all,

determine the version (4.2) and updated all the dependencies after changing the extention_dir

from extension_dir='\xampp\php\ext' to extension_dir='C:\xampp\php\ext'

ahmad
  • 41
  • 3