I'm trying to install laravel/sail into an existing project, which doesn't appear to have had it installed before. This project is normally run on vagrant I believe.
I'm trying to get it running on WSL2, using Laravel Sail. I'm also not entirely sure if that's the best approach in my case.
My understanding is that I can use sail to get the project running via docker, with minimal setup and configuration.
I seem to be getting an error when I try to install sail via composer. These are the instructions I'm following: https://laravel.com/docs/9.x/sail#installing-sail-into-existing-applications
Here's the error:
$ composer require laravel/sail --dev
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20190902/pdo_mysql (/usr/lib/php/20190902/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_mysql.so (/usr/lib/php/20190902/pdo_mysql.so: undefined symbol: mysqlnd_allocator)) in Unknown on line 0
Using version ^1.13 for laravel/sail
./composer.json has been updated
Running composer update laravel/sail
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires laravel/sail ^1.13 -> satisfiable by laravel/sail[v1.13.0, ..., 1.x-dev].
- laravel/sail[v1.13.0, ..., 1.x-dev] require illuminate/contracts ^8.0|^9.0 -> found illuminate/contracts[v8.0.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/sail:*" to figure out if any version is installable, or "composer require laravel/sail:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I'm not entirely sure how to interpret this, but it looks like the version that is attempting to be installed is not compatible with another required package.
composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.4",
"composer-runtime-api": "^2.0",
"aws/aws-sdk-php-laravel": "^3.6",
"doctrine/dbal": "^2.8",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^7.3",
"laravel/framework": "6.*",
"laravel/nexmo-notification-channel": "^2.5",
"laravel/passport": "9.4.*",
"laravel/tinker": "^1.0",
"maatwebsite/excel": "^3.1",
"nexmo/laravel": "^2.4",
"rap2hpoutre/laravel-log-viewer": "1.7.*",
"spatie/laravel-uptime-monitor": "^3.7",
"vonage/client": "^2.4"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-ide-helper": "^2.8",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.1"
},
"autoload": {
"classmap": [
"database",
"app/Http/Controllers",
"app/Console/Commands"
],
"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": {
"platform": {
"php": "7.4"
},
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}