Valet: Tinker shell closing itself on every command

Created on 15 Dec 2018  路  11Comments  路  Source: laravel/valet

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!

Most helpful comment

Use this as a workaround:

In php.ini set pcre.jit=0

All 11 comments

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:
https://github.com/laravel/tinker/issues/63
https://github.com/bobthecow/psysh/issues/540

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

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

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

Use this as a workaround:

In php.ini set pcre.jit=0

I got the same problem using homestead.

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

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

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

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

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

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

@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,
];
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinleblanc picture dustinleblanc  路  4Comments

LucidNinja picture LucidNinja  路  4Comments

dannygsmith picture dannygsmith  路  5Comments

idmahbub picture idmahbub  路  3Comments

Alshie picture Alshie  路  4Comments