error when installing the package on laravel via composer - php

composer require maatwebsite/excel
Using version ^3.1 for maatwebsite/excel
./composer.json has been updated
Running composer update maatwebsite/excel
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages. Problem 1
- maatwebsite/excel[3.1.27, ..., 3.2.x-dev] require phpoffice/phpspreadsheet ^1.16 -> satisfiable by phpoffice/phpspreadsheet[1.16.0, 1.17.0, 1.17.1].
- maatwebsite/excel 3.1.26 requires phpoffice/phpspreadsheet ^1.15 -> satisfiable by phpoffice/phpspreadsheet[1.15.0, 1.16.0, 1.17.0, 1.17.1].
- maatwebsite/excel[3.1.28, ..., 3.1.x-dev] require phpoffice/phpspreadsheet 1.16.* -> satisfiable by phpoffice/phpspreadsheet[1.16.0].
- maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.0.5) does not satisfy that requirement.
- phpoffice/phpspreadsheet[1.15.0, ..., 1.17.1] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
- Root composer.json requires maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, ..., 3.2.x-dev].
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.

You need to enable th gd extension in your php.ini file.
There's a line in there that probably looks like this:
;extension=gd2 (or ;extension=gd) and it needs to be extension=gd2 (or extension=gd).

Laravel Server Requirements mention that BCMath, Ctype, JSON, Mbstring, OpenSSL, PDO, Tokenizer, and XML extensions are required. Most of the extensions are installed and enabled by default.
You can run the following command in Ubuntu to make sure the extensions are installed.
sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip
PHP version-specific installation (if PHP 7.4 installed)
sudo apt install php7.4-common php7.4-bcmath openssl php7.4-json php7.4-mbstring
To see how to install it on windows, Please visit: PHP gd extension install on windows

Related

Magento installation not working after editing php.ini

I tried to install Magento 2.4.5 on windows I am using windows 8.1 by the way and I downloaded xampp8.1.12, composer 2.4.4, and when I typed this command
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition
I got this error :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires magento/product-community-edition 2.4.5-p1 -> satisfiable by magento/product-community-edition[2.4.5-p1].
- magento/product-community-edition 2.4.5-p1 requires ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
Problem 2
- magento/magento2-functional-testing-framework[3.7.0, ..., 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
- Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, ..., 3.12.0].
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files PHP uses in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-intl` to temporarily ignore these required extensions.
The strange thing is that I removed the comma from all of these extensions in the php.ini file:
extension=gd
extension=intl
extension=soap
extension=sockets
extension=sodium
extension=xsl
and I still have the same error
and by the way, when I restart xampp I get this error:
The Procedure entry point crypto_core_ristretto255_scalar _ reduce could not be located in the dynamic link library C:\xampp8.1\php\ext\php_sodium.dll
I tried running this command
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition
but it didn't work
Please make sure below all extensions are enabled in php.ini
sodium
ext-bcmath
ext-ctype
ext-curl
ext-dom
ext-gd
ext-hash
ext-iconv
ext-intl
ext-mbstring
ext-openssl
ext-pdo_mysql
ext-simplexml
ext-soap
ext-xsl
ext-zip
ext-sockets

I'm trying to install maatwebsite/excel package to my laravel with but got this error

I'm trying to install maatwebsite/excel package to my laravel with this command
composer require maatwebsite/excel
but i got this error message instead:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- maatwebsite/excel[3.1.28, ..., 3.1.30] require phpoffice/phpspreadsheet 1.16.* -> satisfiable by phpoffice/phpspreadsheet[1.16.0].
- maatwebsite/excel[3.1.31, ..., 3.1.x-dev] require phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.18.0, 1.19.0, 1.20.0].
- maatwebsite/excel 3.1.27 requires phpoffice/phpspreadsheet ^1.16 -> satisfiable by phpoffice/phpspreadsheet[1.16.0, ..., 1.20.0].
- maatwebsite/excel 3.1.26 requires phpoffice/phpspreadsheet ^1.15 -> satisfiable by phpoffice/phpspreadsheet[1.15.0, ..., 1.20.0].
equirement.
- phpoffice/phpspreadsheet[1.15.0, ..., 1.20.0] require ext-gd * -> it is missing from your system. Install
or enable PHP's gd extension.
- Root composer.json requires maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, ..., 3.1.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require maatwebsite/excel:*" to figure out if any version is installable, or "composer require maatwebsite/excel:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
i'm using :
composer version 2.2.1
PHP version 8.0.1
laravel 8.68.1
what caused this???
The error thrown also gives you the solution, there are some missing packages that the extension requires, just install them separately or allow composer to auto install all with this line:
composer require maatwebsite/excel:*

Composer installation requirements

I am trying to install composer to the laravel project.
When im doing sudo composer install in projects directory it shows me two errors:
Problem 1
- Installation request for simplesoftwareio/simple-qrcode dev-master -> satisfiable by simplesoftwareio/simple-qrcode[dev-master].
- simplesoftwareio/simple-qrcode dev-master requires ext-gd * -> the requested PHP extension gd is missing from your system.
Problem 2
- Installation request for esendex/sdk ^1.3 -> satisfiable by esendex/sdk[v1.3.0].
- esendex/sdk v1.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
I was checking how to install it and I found these commands:
composer require simplesoftwareio/simple-qrcode
composer require esendex/sdk
Anyway, they are giving me the same error. Is there anything I can do about it?
Looks like you have some PHP modules missing.
For PHP5
sudo apt-get install php5-curl
sudo apt-get install php5-gd
For PHP7
sudo apt-get install php7-curl
sudo apt-get install php7-gd
Packages may be different depending on your OS
Is there anything I can do about it?
Yes. You can install the two PHP modules that Composer tells you are required:
simplesoftwareio/simple-qrcode dev-master requires ext-gd * -> the requested PHP extension gd is missing from your system.
esendex/sdk v1.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Exactly how you do that will depend on your operating system.
Ubuntu 16.10, for example, offers php-gd and php-curl system packages.

Laravel with drivers of MongoDB

I'm new using MongoDB in laravel, I want to use laravel 4.2 with MongoDB but I have this problem:
> C:\xampp\htdocs\laravel-mongo>composer require jenssegers/mongodb
Using version ^3.0 for jenssegers/mongodb
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- jenssegers/mongodb v3.0.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.1 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.2 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb has the wrong version (1.0.0) installed.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb has the wrong version (1.0.0) installed.
- Installation request for jenssegers/mongodb ^3.0 -> satisfiable by jenssegers/mongodb[v3.0.0, v3.0.1, v3.0.2].
To enable extensions, verify that they are enabled in those .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 to its original content.
For Laravel 4.2 you would need 2.0.x version of the package
composer require jenssegers/mongodb ^2.0
When you don't specify the version composer grabs the latest stable release by default, which currently happens to be v3.0.2.
This happened to me (for Lumen 5) due to an old mongo installation.
From http://php.net/manual/en/class.mongoclient.php:
Warning: This extension that defines this class is deprecated. Instead,
the MongoDB extension should be used.
Following next steps I was able to get jenssegers/mongodb properly working:
sudo apt-get install php5-dev
sudo pecl install mongodb
Then add to /etc/php5/cli/php.ini or similar:
extension=mongodb.so
And then install the driver
composer require jenssegers/mongodb
ref: http://haafiz.me/development/installing-mongodb-driver-mongoclient-for-php-on-ubuntu

Unable to install laravel 5 on windows via composer

I am trying to get started with laravel on windows and here is the command I tried:
rahul#rahulserver MINGW64 /d/PhpIdeaProjects/LaravelLearning
$ composer create-project laravel/laravel learning-laravel-5
Here is the output I get:
Installing laravel/laravel (v5.0.22)
- Installing laravel/laravel (v5.0.22)
Loading from cache
Created project in learning-laravel-5
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for danielstjules/stringy 1.9.0 -> satisfiable by danielstjules/stringy[1.9.0].
- danielstjules/stringy 1.9.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 2
- Installation request for laravel/framework v5.0.16 -> satisfiable by laravel/framework[v5.0.16].
- laravel/framework v5.0.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
So how shall I move on and have it working?
The requested dependencies require the php extension mbstring as the error explains.
the requested PHP extension mbstring is missing from your system
So install the extension and it should install flawless.
mbstring is built in the libapache2-mod-php5 package. Run
sudo apt-get install libapache2-mod-php5
For windows environments check your php.ini and uncomment the line ;extension=php_mbstring.dll to extension=php_mbstring.dll - then restart your webserver.

Categories