i can not install laravel passport - php

composer require laravel/passport ^v1
result command
./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
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
- Installation request for doctrine/instantiator (installed at 1.1.0) -> satisfiable by doctrine/instantiator[1.1.0].
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": ">=7.0.22",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"laravel/passport": "^1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
how can i solved it

Install php 7.1 and you will be fine.
For ubuntu
https://www.vultr.com/docs/how-to-install-and-configure-php-70-or-php-71-on-ubuntu-16-04
For windows
http://php.net/manual/en/install.windows.php

You have to update your php version to be 7, after that you have to re install your composer and make sure that it will take correct php version

Related

Issue installing laravel-doctrine/migrations package in laravel 9

I am trying to install the migrations on a fresh install of laravel 9, however I am getting this error
Problem 1
Root composer.json requires laravel-doctrine/migrations ^2.3 -> satisfiable by laravel-doctrine/migrations[2.3.0, 2.3.1, 2.x-dev].
laravel-doctrine/migrations[2.3.0, ..., 2.x-dev] require illuminate/config ^6.0|^7.0|^8.0 -> found illuminate/config[v6.0.0,
..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these
were not loaded, likely because it conflicts with another require.
You can also try re-running composer require with an explicit version
constraint, e.g. "composer require laravel-doctrine/migrations:*" to
figure out if any version is installable, or "composer require
laravel-doctrine/migrations:^2.1" if you know which you need.
previously I installed the orm with this command
composer require laravel-doctrine/orm
I have tried to install other versions but the message is the same
composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"laravel-doctrine/orm": "^1.8",
"laravel-doctrine/migrations":"^2.3",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-update-cmd": [
"#php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
UPDATE
I am trying to install the package with laravel 8 however I have this error when executing the command for version ~1.7
command
composer require laravel-doctrine/orm doctrine/inflector:"^1.4|^2.0"
Error
Problem 1
- laravel-doctrine/orm[1.8.0, ..., 1.8.x-dev] require illuminate/support ^9.0 -> found illuminate/support[v9.0.0-beta.1,
..., 9.x-dev] but these were not loaded, likely because it conflicts
with another require.
- Root composer.json requires laravel-doctrine/orm ^1.8 -> satisfiable by laravel-doctrine/orm[1.8.0, 1.8.1, 1.8.x-dev].
You can also try re-running composer require with an explicit version
constraint, e.g. "composer require laravel-doctrine/orm:*" to figure
out if any version is installable, or "composer require
laravel-doctrine/orm:^2.1" if you know which you need.
doctrine-migrations does not support laravel 9 at yet. See this discussion
It will be supported after it upgrade to doctrine/migrations 3 in this Pull Request
So if you want to really install doctrine/migrations, you need to use Laravel 8 instead of laravel 9.
Otherwise, you need to wait untill that PR merged and released
SOLVED
Currently doctrine/migrations can be installed using this command
composer require laravel-doctrine/orm "^1.7" doctrine/inflector:"^1.4|^2.0"
after install the packages you can install migations with no problems
Note that version 1.7 must be specified in the command, since it does not appear explicitly in the documentation

Can't install backpack genreators.Laravel version 7.10

I have a freshly installed Laravel 7.10.* I want to install the Backpack composer require backpack/generators --dev but cannot install the generators. Here is the error.
Your requirements could not be resolved to an installable set of packages.
Problem 1
Installation request for laravel/framework (locked at v7.10.3, required ^7.0) -> satisfiable by laravel/framework[v7.10.3].
Installation request for backpack/generators ^3.0 -> satisfiable by backck/generators[3.0.0, v3.0.1, v3.x-dev].
Can only install one of: backpack/crud[4.1.x-dev, 4.0.61].
Can only install one of: backpack/crud[4.1.x-dev, 4.0.61].
Can only install one of: backpack/crud[4.1.x-dev, 4.0.61].
Conclusion: install backpack/crud 4.1.x-dev
Installation request for backpack/crud (locked at 4.0.61, required as 4.*) -> satisfiable by backpack/crud[4.0.61].`
Installation failed, reverting ./composer.json to its original content.
This is my composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"backpack/crud": "4.0.*",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
The problem is that you locked the backpack/crud version as 4.0.*, but for the backpack/generators the satisfiable versions are these: 4.1.0, 4.1.1, 4.1.x-dev
So you should change this line in your composer.json:
"backpack/crud": "4.0.*",
to this:
"backpack/crud": "4.1.*",
then update the composer packages:
composer update
and finally install the generator package:
composer require backpack/generators --dev

Can't make "composer require laravel/ui --dev" on laravel 6.5.1

I am getting following error :
Can't make "composer require laravel/ui --dev" on laravel 6.5.1. I get an error
"Your requirements could not be resolved to an installable set of packages.
Problem 1:
Conclusion: remove laravel/framework v6.5.1
Conclusion: don't install laravel/framework v6.5.1
Installation failed, reverting ./composer.json to its original content.
In my 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": "^1.0",
"laravelcollective/html": "^5.2.0",
"tcg/voyager": "^1.3"
},
"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": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"repositories": {
"hooks": {
"type": "composer",
"url": "https://larapack.io"
}
}
}
Php version 7.2.25
Please, help.
Version 2 of laravel/ui isn't compatible with version 6 of Laravel so installs the version 1 with composer require laravel/ui="1.*" --dev
The command to implement Auth is as follows:
composer require laravel/ui
php artisan ui vue --auth
OR
composer require laravel/ui --dev
php artisan ui vue --auth
If your Login and Register page only shows plain HTML. And CSS is not loading properly then run this two command:
npm install
npm run dev
Try this command, it worked for me:
$ composer require laravel/ui "^1.2"
composer require laravel/ui "^1.2" works...laravel 6 versions can only run
laravel/ui 1.2.0:
See Packagist for older versions
https://packagist.org/packages/laravel/ui#v1.2.0. ----------------------
Also check out laravel 6 docs
https://laravel.com/docs/6.x/frontend -----------------------
I faced the same issue with laravel 6.17. You can try to use this command instead :
composer require laravel/ui="1.*" - -dev
In my conclusion that laravel 6.x not compatible with laravel/ui version ^2.0. That command works for me.

composer global require fails where non global equivalent succeeds

Im developing a package available at packagist as user/package. Installing it locally works just fine
composer require user/package
Creating a new project is also fine
composer create-project --prefer-dist user/package new-project
But the package is to be deployed globally
composer global require user/package
however this results in the following error log.
Changed current directory to /home/anders/.composer ./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 user/package ^v0.0.3 -> satisfiable by user/package[v0.0.3].
- Conclusion: remove illuminate/container v5.5.2
- Conclusion: don't install illuminate/container v5.5.2
- don't install tightenco/collect v5.4.33|don't install laravel/framework v5.5.2
- don't install laravel/framework v5.5.2|remove tightenco/collect v5.4.33
- Installation request for illuminate/container (installed at v5.5.2) -> satisfiable by illuminate/container[v5.5.2],
laravel/framework[v5.5.2].
- Installation request for tightenco/collect (installed at v5.4.33) -> satisfiable by tightenco/collect[v5.4.33].
Installation failed, reverting ./composer.json to its original
content.
How can this be?
I have tried composer global clearcache
Deleted a composer.lock file I found directly under /home/anders/.composer/
Upgraded my dependencies (Laravel) from 5.5.x to 5.6.x with no effect
Even creating a fresh "laravel new blog" project and uploading to packagist fails with the same error message.
Here is my composer.json
{
"name": "user/package",
"description": "Package",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"ajthinking/tinx": "^2.1",
"fideloper/proxy": "~3.3",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"bin": [
"package"
]
}
Would really appreciate help interpreting the error log. Thanks!
Update
This is the content of /home/anders/.composer/
{
"require": {
"cpriego/valet-linux": "^2.0",
"laravel/installer": "^1.4",
"phpunit/phpunit": "^6.4",
"phpunit/dbunit": "^3.0"
}
}
Composer version: 1.6.5
If this is standalone tool, you should consider building PHAR for it. You can use kherge/box to simplify build process.
PHAR archive is completely standalone, so you'll get rid of all problems with conflicting global dependencies. It may also simplify installation (you need to just download archive and make it executable) for both global and local installation.

How to install Jaxon 2.0 in Laravel 5.3

Good day.
I followed the tutorial instruccions to install.
Installation
Add the following lines in the composer.json file, and run the composer update command.
"require": {
"jaxon-php/jaxon-laravel": "~2.0"
}
But i recieve the following error:
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
- The requested package jaxon-php/jaxon-laravel ~2.0 is satisfiable by jaxon-php/jaxon-laravel[v2.0-beta.1, v2.0-beta.2, v2.0-beta.3, v2.0-beta.4, v2.0-beta.5, v2.0-beta.6] but these conflict with your requirements or minimum-stability.
This is my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"laravelcollective/html": "^5.3.0",
"yajra/laravel-datatables-oracle": "^6.20",
"elibyy/tcpdf-laravel": "5.3.*",
"iatstuti/laravel-nullable-fields": "~1.0",
"orangehill/iseed": "2.2",
"jaxon-php/jaxon-laravel": "~2.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
Any ideas? Thank you.
Googling arround i think i found my problem:
Since jaxon is in BETA version and composer default minimun stability requeriments are STABLE, composer failed to install the package.
I added this 2 lines to my composer.json:
"minimum-stability": "beta",
"prefer-stable": true,
Source:
http://webtips.krajee.com/setting-composer-minimum-stability-application/
https://getcomposer.org/doc/04-schema.md#minimum-stability

Categories