Your requirements could not be resolved: failed to open stream: Permission denied - composer-php

I Need to install DomPDf in my Project. So, i add "barryvdh/laravel-dompdf": "v0.7.0", to composer require block. when i update composer display following Errors. Whats my Mistakes.... Please Specify to me..
Terminal Errors
Your requirements could not be resolved to an installable set of packages.
Problem 1
- dompdf/dompdf v0.7.0-beta3 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf v0.7.0-beta2 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf v0.7.0-beta requires phenx/php-font-lib 0.3.* -> no matching package found.
- dompdf/dompdf v0.7.0 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf 0.7.x-dev requires phenx/php-font-lib 0.5.* -> no matching package found.
- barryvdh/laravel-dompdf v0.7.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[0.7.x-dev, v0.7.0, v0.7.0-beta, v0.7.0-beta2, v0.7.0-beta3].
- Installation request for barryvdh/laravel-dompdf v0.7.0 -> satisfiable by barryvdh/laravel-dompdf[v0.7.0].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
My Composer Code
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"minimum-stability" : "dev",
"prefer-stable": true,
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"barryvdh/laravel-debugbar": "^2.3",
"barryvdh/laravel-dompdf": "v0.7.0",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"uxweb/sweet-alert": "^1.4"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
}
I've also tried:
composer require barryvdh/laravel-dompdf
but it display following error:
Error : Using version ^0.8.0 for barryvdh/laravel-dompdf ./composer.json has been updated Loading composer repositories with package information
Updating dependencies (including require-dev)
file_put_contents(/home/w3cert/.composer/cache/repo/https---‌​packagist.org/p-prov‌​ider-2017-01.json): failed to open stream: Permission denied
packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Your requirements could not be resolved to an installable set of packages.

Since you've got the Permission denied error when running composer require barryvdh/laravel-dompdf, this is the command which should fix them:
chown -R $USER ~/.composer
or:
sudo chown -R $USER ~/.composer
Then clear the Composer caches:
composer clear
After than try to avoid running composer command with sudo to not break the file permissions.
If there is still any problem, in order to troubleshoot, run the following shell command:
composer diagnose

Why don't you try to install it from the command line
composer require barryvdh/laravel-dompdf
please delete this line from composer.json before installation.
"barryvdh/laravel-dompdf": "v0.7.0"
Anyway the current version of laravel-dompdf:(v0.8.0)

The installation should work with the current version of dompdf
"barryvdh/laravel-dompdf": "^0.8.0"

Related

Composer stating requirements not met

I have a simple composer package with the following require:
{
"require": {
"vlucas/phpdotenv": "^5.4",
"wp-cli/wp-cli-bundle": "^2.6"
}
}
When I run the app, I get the following error:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".
Looking at the composer.json of each package, the current version of PHP I am using (7.4) should be viable. (I have to use 7.4 as one WP plugin breaks with php >8).
Dotenv reports:
"require": {
"php": "^7.1.3 || ^8.0",
...
and wp-cli-bundle reports:
"require": {
"php": ">=5.6",
...
Confused as to why I am getting error issue.

Problem with installing a Laravel package using composer

I want to using a package in my project.
Composer.json:
"require": {
"php": "^7.2.5|^8.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
"hekmatinasser/verta": "^1.11",
"laravel/framework": "^7.29",
"laravel/passport": "^9.3",
"laravel/tinker": "^2.5",
"lcobucci/jwt": "3.3.3",
"pishran/zarinpal": "^2.2"
},
My target package to install :
composer require ipecompany/smsirlaravel
Problem : When I try this on composer, I see follwing error
Problem 1
- ipecompany/smsirlaravel[v1.0.0, ..., v1.0.7] require guzzlehttp/guzzle ~6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but the package is fixed to 7.2
.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires ipecompany/smsirlaravel ^1.0 -> satisfiable by ipecompany/smsirlaravel[v1.0.0, ..., v1.0.7].
I tried :
composer require ipecompany/smsirlaravel -W
But the main problem is Laravel Passport maybe because of following error :
Problem 1
- laravel/passport is locked to version v9.3.2 and an update of this package was not requested.
- laravel/passport v9.3.2 requires laminas/laminas-diactoros ^2.2 -> found laminas/laminas-diactoros[2.2.0, ..., 2.6.x-dev] but it conflicts with another require.
I tried to install laminas/laminas-diactoros ^2.2 but I got another error
problem 1
- Root composer.json requires laminas/laminas-diactoros 2.2, found laminas/laminas-diactoros[2.2.0] but it conflicts with another require.
Problem 2
- laravel/passport is locked to version v9.3.2 and an update of this package was not requested.
- laravel/passport v9.3.2 requires laminas/laminas-diactoros ^2.2 -> found laminas/laminas-diactoros[2.2.0, ..., 2.6.x-dev] but it conflicts with another require.
Any body can help me to install this package? TNX
As written in the first error message: ipecompany/smsirlaravel requires v6 of Guzzle, but currently v7 is installed. You should use a different version constraint for Guzzle first: change "guzzlehttp/guzzle": "^6.3.1|^7.0.1" to "guzzlehttp/guzzle": "^6.3.1". Afterwards, run composer update guzzlehttp/guzzle such that Guzzle v6 is installed.
Afterwards, running composer require ipecompany/smsirlaravel should work

Error installing package (Installation failed, reverting ./composer.json to its original content.) (Laravel admin package - Voyager) [duplicate]

This question already has answers here:
Composer error: "PHP extension fileinfo is missing from your system"
(12 answers)
How can I resolve "Your requirements could not be resolved to an installable set of packages" error?
(17 answers)
Closed 3 years ago.
i want to install a laravel admin package -voyager version 1.3 ,so when i run this cmd $ composer require tcg/voyager i got this error always , is about the file composer.json
Using version ^1.3 for tcg/voyager
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
- tcg/voyager v1.3.0 requires intervention/image ^2.4 -> satisfiable by intervention/image[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1].
- tcg/voyager v1.3.1 requires intervention/image ^2.4 -> satisfiable by intervention/image[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1].
- intervention/image 2.4.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- intervention/image 2.4.2 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- Installation request for tcg/voyager ^1.3 -> satisfiable by tcg/voyager[v1.3.0, v1.3.1].
To enable extensions, verify that they are enabled in your .ini files:
- C:\AppServ\php7\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.
and this is the file composer.json :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.2",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
}, ..
, Do you know how to solve that? my laravel version : 6.12
Try enabling php_fileinfo.dll in you php.ini file. Just remove ; from the below line and restart your server
;extension=php_fileinfo.dll

composer installation fails - jimmyjs/laravel-report-generator

Trying to install jimmyjs/laravel-report-generator
Command:
composer require jimmyjs/laravel-report-generator
Output:
vagrant#homestead:~/code/BEAM$ composer require jimmyjs/laravel-report-generator
Using version ^1.1 for jimmyjs/laravel-report-generator
./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
- Can only install one of: maatwebsite/excel[2.1.x-dev, 3.1.11].
- Can only install one of: maatwebsite/excel[3.1.11, 2.1.x-dev].
- Can only install one of: maatwebsite/excel[2.1.x-dev, 3.1.11].
- jimmyjs/laravel-report-generator 1.1.0 requires maatwebsite/excel ~2.1.0
-> satisfiable by maatwebsite/excel[2.1.x-dev].
- Installation request for jimmyjs/laravel-report-generator ^1.1
-> satisfiable by jimmyjs/laravel-report-generator[1.1.0].
- Installation request for maatwebsite/excel (locked at 3.1.11, required as ^3.1)
-> satisfiable by maatwebsite/excel[3.1.11].
Installation failed, reverting ./composer.json to its original content.
I don't know if I'm misunderstanding the error? Says I can only have one maatwebsite (which is the case)?
composer.json current require which has maatwebsite (only instance) in it:
"require": {
"php": ">=7.1.3",
"barryvdh/laravel-snappy": "^0.4.4",
"fideloper/proxy": "^4.0",
"h4cc/wkhtmltoimage-amd64": "0.12.x",
"h4cc/wkhtmltopdf-amd64": "0.12.x",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.6",
"maatwebsite/excel": "^3.1",
"spatie/laravel-permission": "^2.13"
},
if you need explicitly that version of Maatwebsite ("maatwebsite/excel": "^3.1",), then you cant fix it cause jimmyjs/laravel-report-generator is not up to date with the new version of maatwebsite.
if you dont need the version 3 of Maatwebsite, you can remove the requirement for it and jimmyjs/laravel-report-generator will require the version maatwebsite/excel 2.1.x-dev.
wich might have some issue with your current version of php (7.1).
Better look for another alternative to jimmyjs/laravel-report-generator that uses the V3 of maatwebsite or something else
Or even better, do it yourself instead of using jimmyjs/laravel-report-generator. Maatwebsite v3 is really easy to use
If you have looked it then your version is 3.1 "maatwebsite/excel": "^3.1",
Now check your error
Problem 1
- Can only install one of: maatwebsite/excel[2.1.x-dev, 3.1.11].
it says you need to install in "maatwebsite/excel": "^2.1"
Change and Add in your composer.json file:
"require": {
"jimmyjs/laravel-report-generator": "^1.1",
"maatwebsite/excel": "^2.1"
},
after, run this command in your command prompt composer update

Why can't I install oauth2 client?

getting some strange errors with composer, anyone know what I can do next? I am trying to install oauth2 client on Laravel 5.1 so that I can use it to connect to an affiliate network API.
Using version ~2.2 for league/oauth2-client
./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
- Installation request for league/oauth2-client ~2.2 -> satisfiable by league/oauth2-client[2.2.0].
- Conclusion: remove paragonie/random_compat v1.4.2
- league/oauth2-client 2.2.0 requires paragonie/random_compat ^2.0 -> satisfiable by paragonie/random_compat[v2.0.0, v2.0.1, v2.0.10, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
- Can only install one of: paragonie/random_compat[v2.0.0, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.1, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.10, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.2, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.3, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.4, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.5, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.6, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.7, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.8, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.9, v1.4.2].
- Installation request for paragonie/random_compat == 1.4.2.0 -> satisfiable by paragonie/random_compat[v1.4.2].
Installation failed, reverting ./composer.json to its original content.
my composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"bestmomo/scafold": "dev-master",
"illuminate/html": "5.*",
"barryvdh/laravel-dompdf": "0.6.*",
"davejamesmiller/laravel-breadcrumbs": "~3.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database",
"app/helpers"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
The output of your install attempt has all the information:
Currently there is paragonie/random_compat v1.4.2 installed. Your new package requires paragonie/random_compat ^2.0 - this is an incompatible change (simply by looking at the version number, not at the code), so Composer cannot simply install the newer version.
However, some component already installed requires that older version. You can find out which one it is by running composer why paragonie/random_compat, and you can also find out why it wasn't possible to install the newer version by running composer why-not paragonie/random_compat ^2.0, which will probably output the same information.
All in all I think the suggestion on how to solve this is: Upgrade Laravel. 5.1 is rather old, and it depends on paragonie/random_compat in version ~1.4. Newer versions of Laravel (5.3 and 5.4) allow either ~1.4 or ~2.0, which would fix your issue.
I haven't looked deeper into this issue, though. It might be possible that another component also depends on this library and would also need to be updated. Laravel was my first guess.

Resources