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

Tinker shell closing itself on every command #687

Closed
reneroth opened this issue Dec 15, 2018 · 11 comments
Closed

Tinker shell closing itself on every command #687

reneroth opened this issue Dec 15, 2018 · 11 comments

Comments

@reneroth
Copy link

Switched from Homestead to valet because I'm curious.

Now, running php artisan tinker will still open the shell, but any executed command closes the shell without error message or displaying the result. Doing php artisan tinker 'command' to immediately execute a shell command will cause the same.

  • It happens for every command - so App\Models\User::first() and 1+1 both cause the closing.
  • There have been zero custom console commands created
  • It does not happen on Homestead
  • laravel log is empty

Any help on how to further debug this is greatly appreciated!

@drbyte
Copy link
Contributor

drbyte commented Dec 15, 2018

This isn't directly a Valet issue, but rather with one of its dependencies.

It's a problem with PsySh (used by Tinker) and Homebrew's PHP 7.3.0 build.

Related:
laravel/tinker#63
bobthecow/psysh#540

You could use one of the posted workarounds in the PsySh link or downgrade to PHP 7.2

@reneroth
Copy link
Author

Thank you for your help, @drbyte ! My Google-fu failed me this time

@drbyte
Copy link
Contributor

drbyte commented Dec 15, 2018

No worries - I ran into the same thing a couple days ago, so your post gave me an extra reason to document it.

@rsm23
Copy link

rsm23 commented Dec 24, 2018

Use this as a workaround:

In php.ini set pcre.jit=0

@Crepu
Copy link

Crepu commented Mar 5, 2019

I got the same problem using homestead.

Work for me running php artisan tinker inside the Homestead enviroment, after use vagrant ssh.

@svnblame
Copy link

Solution provided by @rsm23 worked for me. Using Laravel Valet.

@expired-brain
Copy link

Solution from @rsm23 worked.
Problem was created after upgrade my HomeBrew.

@tallahHGA
Copy link

@rsm23 solution worked for me also, thanks a lot.
The cause i am still unsure about.

@troehrkasse
Copy link

Much thanks to @rsm23, solution worked for me as well.

@reneroth
Copy link
Author

reneroth commented May 8, 2019

Please friends, I do not need to receive an email every time one of you discovers that the solution marked as working is working :)

@meduzen
Copy link

meduzen commented Aug 23, 2019

@bobthecow in the PsySH issue recommends to disable PCNTL support in the PsySH config file (~/.config/psysh/config.php). It works for me (PHP 7.3.7, MacOS 10.14.16).

return [
  'usePcntl' => false,
];

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

No branches or pull requests

9 participants