Cant install mPDF package using Composer PHP - requires ext-gd - php

I am trying to install mPDF package and when I run the command composer require mpdf/mpdf it displays these errors:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested PHP extension ext-gd * is missing from your system. Install or enable PHP's gd extension.
Problem 2
- mpdf/mpdf v8.0.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- mpdf/mpdf v8.0.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- mpdf/mpdf v8.0.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- Installation request for mpdf/mpdf ^8.0 -> satisfiable by mpdf/mpdf[v8.0.0, v8.0.1, v8.0.2].
To enable extensions, verify that they are enabled in your .ini files:
- C:\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.
Can I just download mPDF and place it in my working repo? Or do I have to use Composer to install it?
I tried to search for this errors and I think the only solution would be to install chocolatey and then use it to install php7.3.2-gd , but if there is a better solution please let me know!

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

Library GD issue

While installing maatwebsite/excel composer it is throwing an error regarding gd library is missing. But I checked in my system gd is already enabled.
Please see the error message below. I also attached a screenshot for the error and phpinfo screen.
Your requirements could not be resolved to an installable set of packages.
Problem 1
Installation request for phpoffice/phpspreadsheet 1.14.1 -> satisfiable by phpoffice/phpspreadsheet[1.14.1].
phpoffice/phpspreadsheet 1.14.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.
Problem 2
phpoffice/phpspreadsheet 1.14.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.
maatwebsite/excel 3.1.21 requires phpoffice/phpspreadsheet ^1.14 -> satisfiable by phpoffice/phpspreadsheet[1.14.1].
Installation request for maatwebsite/excel 3.1.21 -> satisfiable by maatwebsite/excel[3.1.21].
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
- /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
- /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
- /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

Cannot Update Composer in Command Line

I am updating the composer and it shows up some error like below.
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
- pusher/pusher-php-server v3.4.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- pusher/pusher-php-server v3.4.0 requires php >=5.4 <7.3 -> your PHP version (7.3.6) does not satisfy that requirement.
- pusher/pusher-php-server v3.3.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- pusher/pusher-php-server v3.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- pusher/pusher-php-server 3.4.x-dev requires ext-curl * -> the requested PHP extension curl is missing from your system.
- Installation request for pusher/pusher-php-server ^3.3 -> satisfiable by pusher/pusher-php-server[3.4.x-dev, v3.3.0, v3.3.1, v3.4.0, v3.4.1].
To enable extensions, verify that they are enabled in your .ini files:
- C:\PHP7\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
the pusher v3 doesn't support php version that higher than 7.3
there are some options :
first is downgrade the php to the requirement (not recomended), the second one is use this command to upgrade the pusher to version 4
composer require pusher/pusher-php-server
could please check curl enabled in your php use ;extension=php_curl.dll remove semi colon in php.ini file and try
try following command
install first curl using following command.
sudo apt-get install curl
then use
sudo apt-get install composer

PHP Mongodb installation issue on Linux Mint 17.3 Rosa

I am new to mongodb ,
I am following one tutorial and proceeding step by step , I installed mongodb and access it from shell .
Then I am doing php mongodb installation part .
I am doing it through composer , install composer and run the below command
composer require mongodb/mongodb
I am getting this below error output in my terminal .
$ composer require mongodb/mongodb
Using version ^1.4 for mongodb/mongodb
./composer.json has been created
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
- mongodb/mongodb 1.4.2 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.4.1 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.4.0 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for mongodb/mongodb ^1.4 -> satisfiable by mongodb/mongodb[1.4.0, 1.4.1, 1.4.2].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php5/cli/php.ini
- /etc/php5/cli/conf.d/05-opcache.ini
- /etc/php5/cli/conf.d/10-pdo.ini
- /etc/php5/cli/conf.d/20-json.ini
- /etc/php5/cli/conf.d/20-mysql.ini
- /etc/php5/cli/conf.d/20-mysqli.ini
- /etc/php5/cli/conf.d/20-pdo_mysql.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, deleting ./composer.json.
Here I added this things to my php.ini file and restarted the apache file.
extension = mongodb.so
PHP VERSION - PHP 5.5.9 AND Linux Mint 17.3 Rosa
Any suggestion?
where I am doing wrong

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