Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing jetstream with specific php version, installer rolls back to system default php executable #1405

Closed
apocsrbs opened this issue Nov 21, 2023 · 8 comments

Comments

@apocsrbs
Copy link

Jetstream Version

4.1

Jetstream Stack

Livewire

Laravel Version

10.2.9

PHP Version

8.2

Database Driver & Version

No response

Description

When installing laravel/jetstream using a non-default php-version, Jetstream somehow rolls back to the system-default (php)

Steps To Reproduce

Executing these commands:

#php8.2 /usr/bin/composer create-project laravel/laravel .
#php8.2 /usr/bin/composer require laravel/jetstream
#php8.2 artisan jetstream:install livewire

Last command results in this error:

INFO Migration created successfully.

Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
Do not run Composer as root/super user! See https://getcomposer.org/root for details
./composer.json has been updated
Running composer update livewire/livewire
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 php ^8.1 but your php version (7.3.33) does not satisfy that requirement.
Problem 2
- laravel/framework is locked to version v10.32.1 and an update of this package was not requested.
- laravel/framework v10.32.1 requires php ^8.1 -> your php version (7.3.33) does not satisfy that requirement.
Problem 3
- laravel/jetstream is locked to version v4.1.0 and an update of this package was not requested.
- laravel/jetstream v4.1.0 requires php ^8.1.0 -> your php version (7.3.33) does not satisfy that requirement.
Problem 4
- laravel/sanctum is locked to version v3.3.2 and an update of this package was not requested.
- laravel/sanctum v3.3.2 requires php ^8.0.2 -> your php version (7.3.33) does not satisfy that requirement.
Problem 5
- fakerphp/faker is locked to version v1.23.0 and an update of this package was not requested.
- fakerphp/faker v1.23.0 requires php ^7.4 || ^8.0 -> your php version (7.3.33) does not satisfy that requirement.
Problem 6
- laravel/pint is locked to version v1.13.6 and an update of this package was not requested.
- laravel/pint v1.13.6 requires php ^8.1.0 -> your php version (7.3.33) does not satisfy that requirement.
Problem 7
- laravel/sail is locked to version v1.26.0 and an update of this package was not requested.
- laravel/sail v1.26.0 requires php ^8.0 -> your php version (7.3.33) does not satisfy that requirement.
Problem 8
- nunomaduro/collision is locked to version v7.10.0 and an update of this package was not requested.
- nunomaduro/collision v7.10.0 requires php ^8.1.0 -> your php version (7.3.33) does not satisfy that requirement.
Problem 9
- phpunit/phpunit is locked to version 10.4.2 and an update of this package was not requested.
- phpunit/phpunit 10.4.2 requires php >=8.1 -> your php version (7.3.33) does not satisfy that requirement.
Problem 10
- spatie/laravel-ignition is locked to version 2.3.1 and an update of this package was not requested.
- spatie/laravel-ignition 2.3.1 requires php ^8.1 -> your php version (7.3.33) does not satisfy that requirement.
Problem 11
- symfony/deprecation-contracts v3.4.0 requires php >=8.1 -> your php version (7.3.33) does not satisfy that requirement.
- guzzlehttp/guzzle 7.8.0 requires symfony/deprecation-contracts ^2.2 || ^3.0 -> satisfiable by symfony/deprecation-contracts[v3.4.0].
- guzzlehttp/guzzle is locked to version 7.8.0 and an update of this package was not requested.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

@driesvints
Copy link
Member

That's odd because it first tries to look for PHP_BINARY which should be the binary that's in use when running the script. I don't know why this isn't working for you. I can't try this out myself right now but could you try this:

php8.2 -a
echo PHP_BINARY

And then show what that gives?

@apocsrbs
Copy link
Author

That's odd because it first tries to look for PHP_BINARY which should be the binary that's in use when running the script. I don't know why this isn't working for you. I can't try this out myself right now but could you try this:

php8.2 -a
echo PHP_BINARY

And then show what that gives?

Hi @driesvints - It returns nothing at all

@driesvints
Copy link
Member

Sorry, that's echo PHP_BINARY;

@apocsrbs
Copy link
Author

Sorry, that's echo PHP_BINARY;

That gives me: /usr/bin/php8.2

@driesvints
Copy link
Member

That seems correct. The installer should have picked this up. I don't know why that doesn't happen for you.

Could you maybe try a dd in this method to see what this result gives you?

https://github.com/laravel/jetstream/blob/4.x/src/Console/InstallCommand.php#L825

@apocsrbs
Copy link
Author

I wasn't able to dd() in that function so I tried returning a hardcoded string with "/usr/bin/php8.2" which didn't work.
I also tried calling $this->phpBinary() on the first line of the handle method, and it returned "/usr/bin/php8.2".

@apocsrbs
Copy link
Author

Problem solved! Not that it makes any sense though...

If I specify the composer "binary" it works - even though it's the same composer 🤪

So if I call this command "php8.2 artisan jetstream:install livewire --composer=/usr/bin/composer" it works...

@driesvints
Copy link
Member

Weird one.. glad you got that working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants