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
Related
I'm trying to install two packages. The passport and the auth. The Auth is because the passport requires this package, but when trying to install the passport, it says that it already finds a version but that it is not active/installed because of a conflict with another package.
I have no idea, I did some tests here, but I couldn't solve it. I really need help
I'll leave my composer.json below
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5|^8.0",
"aws/aws-sdk-php": "^3.208",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3",
"kitetail/zttp": "^0.6.0",
"laracasts/flash": "^3.2",
"laravel/framework": "^7.29",
"laravel/tinker": "^2.5",
"laravel/ui": "2.4",
"maatwebsite/excel": "^3.1",
"timehunter/laravel-google-recaptcha-v2": "~1.0.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"lucascudo/laravel-pt-br-localization": "^1.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.3",
"phpunit/phpunit": "^8.5.8|^9.3.3"
},
"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"
]
}
}
These are the errors/warnings you get when trying to install each package
composer require laravel/passport:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires laravel/passport ^10.4 -> satisfiable by laravel/passport[v10.4.0, v10.4.1, 10.x-dev].
- laravel/passport[v10.4.0, ..., 10.x-dev] require illuminate/auth ^8.37|^9.0 -> found illuminate/auth[v8.37.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.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/passport:*" to figure out if any version is installable, or "composer require laravel/passport:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
composer require illuminate/auth ^8.37:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires illuminate/auth 8.37, found illuminate/auth[v8.37.0] but these were not loaded, likely because it conflicts with another require.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I have created a Laravel distro package with all Laravel packages that all of my websites use.
I've also created a custom Laravel-website that uses this distro package.
Unfortunately when I run composer install --dev on the 2nd composer file, it won't install the require-dev packages from the laravel-distro composer package, e.g. phpunit/phpunit
Laravel-distro composer configuration:
$ cat laravel-distro/composer.json
{
"name": "dennis00/laravel-distro",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravel/installer": "^2.0.1"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"vendor-dir": "vendor",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"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"
]
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Laravel-example composer configuration:
$ cat laravel-example/composer.json
{
"name": "dennis00/laravel-example",
"description": "Example of Laravel Distro",
"type": "project",
"license": "GPL-2.0+",
"minimum-stability": "dev",
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"autoload": {
"classmap": [
"scripts/composer/ScriptHandler.php"
]
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"require": {
"dennis00/laravel-distro": "dev-master#dev",
"laravel/horizon": "^4.0#dev"
}
}
You can see the require-dev packages are missing here.
root#f506ece6f4ea:/var/www/html# ls vendor
autoload.php cakephp dennis00 doctrine egulias fideloper jakub-onderka laravel monolog nette ocramius paragonie phpstan psy ramsey symfony vlucas
bin composer dnoegel dragonmantank erusev guzzlehttp jean85 league nesbot nikic opis phpoption psr ralouphie swiftmailer tijsverkoyen
root#f506ece6f4ea:/var/www/html# ls vendor_backup/
autoload.php bin dnoegel dragonmantank erusev filp hamcrest laravel mockery myclabs nikic opis phar-io phpoption phpunit psy sebastian symfony tijsverkoyen webmozart
beyondcode composer doctrine egulias fideloper fzaninotto jakub-onderka league monolog nesbot nunomaduro paragonie phpdocumentor phpspec psr ramsey swiftmailer theseer vlucas
root#f506ece6f4ea:/var/www/html#
It won't, this is intentional.
As the packages are in the require-dev section of the first base package.json file, this will only be installed if you are running composer install on that package.
As you are pulling that package into another project, composer will only install those dependencies from the package that are not within require-dev.
This is because require-dev is only for the development of that package and should not be required to use the package in something else. If you need these packages to be installed when you are using your base package, then you must put them in require and not require-dev.
Can you answer me?
I use the latest version of Laravel and I want to add to my project the PayPal service.
I want to install some package to Laravel and added this 2 rows to composer.json
"guzzlehttp/guzzle": "~5.2",
"paypal/rest-api-sdk-php": "*"
My composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"fideloper/proxy": "~3.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"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": [
"/usr/local/bin/php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"/usr/local/bin/php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"/usr/local/bin/php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true,
"cache-dir": "/home/iamdevco/public_html/norrisms/designer/cache"
},
"guzzlehttp/guzzle": "~5.2",
"paypal/rest-api-sdk-php": "*"
}
but I get this error after download packages
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
/usr/local/bin/php artisan package:discover
The system cannot find the path specified.
Script /usr/local/bin/php artisan package:discover handling the post-autoload-dump event returned with error code 1
after you install all packages run
composer dumpautoload
packages
composer require guzzlehttp/guzzle-services
composer require paypal/rest-api-sdk-php
composer dumpautoload
Rather than manually writing the composer.json, try installing and adding them with the specific commands. Like this.
composer require paypal/rest-api-sdk-php
composer require guzzlehttp/guzzle
That way, you'll avoid any typos and composer.json file will be kept as pure as possible.
Try this composer require paypal/rest-api-sdk-php
Ref: https://packagist.org/packages/paypal/rest-api-sdk-php
Edit:
remove the paypal/rest-api-sdk-php on the composer.json and the guzzle then try this
composer require guzzlehttp/guzzle
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
I'm using a Laravel project as a local plugin of Moodle, using the composer/installer package. The layout of the project is:
// Moodle Application
- composer.json
- local/
- laravel-plugin/ <- here is the Laravel local plugin
- composer.json <- composer.json of Laravel plugin
The composer.json of the Moodle application
{
"name": "moodle/moodle",
"license": "GPL-3.0",
"description": "Moodle - the world's open source learning platform",
"type": "project",
"homepage": "https://moodle.org",
"require": {
"composer/installers": "~1.0",
"Pursuittech/sam": "dev-master" <- here is the Laravel local plugin
},
"require-dev": {
"phpunit/phpunit": "5.5.*",
"phpunit/dbUnit": "1.4.*",
"moodlehq/behat-extension": "3.33.1",
"mikey179/vfsStream": "^1.6"
},
"repositories": [
{
"type": "vcs",
"url": "git#github.com:Pursuittech/sam.git"
}
]
}
composer.json of the Laravel local plugin
{
"name": "Pursuittech/sam",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "moodle-local",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"composer/installers": "~1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"Api\\": "api/",
"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
}
}
When I try to install the Laravel plugin using php composer.phar -vvv update, I hang on "Resolving dependencies through SAT".
I found a similar question which has the problem when only dealing with Laravel 4.2 in isolation. I haven't been through everything in the list and will update when I have.
My question is, is it normal for "Resolving dependencies through SAT" to hang when combining large composer projects like Laravel and Moodle? Are there any immediate steps I can take to reduce the complexity of the problem?
try those steps maybe you will get more reasonable output, its probably conflict of package version (eg. one of the packages locked on version which does not satisfy other package)
try no-dev option first
composer update --no-dev -vvv
try updating package by package
composer update some/package --no-dev -vvv
try to delete vendor folder and composer.lock
finally check composer.json of each package and compare requirements search for versions which exclude themselves from working together