Roboroads/laravel-tinker

PHP Fatal error: Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP?

guiireal opened this issue · 10 comments

What's happening?

I created a new Laravel project and went to test tinker, this appeared

Laravel Version: 9.19.0
PHP Version: 8.1.3
PhpStorm 2022.1.2

image

PHP Fatal error:  Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP? in D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
Stack trace:
#0 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(257): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_exists(): ...', 'D:\\Gui\\Tecnolog...', 791)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(2, 'file_exists(): ...', 'D:\\Gui\\Tecnolog...', 791)
#2 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(791): file_exists('hoa://Library/T...')
#3 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(811): Psy\Readline\Hoa\ConsoleTput::getTerminfo()
#4 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Userland.php(43): Psy\Readline\Hoa\ConsoleTput::isSupported()
#5 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Configuration.php(822): Psy\Readline\Userland::isSupported()
#6 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Configuration.php(794): Psy\Configuration->getReadlineClass()
#7 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Shell.php(92): Psy\Configuration->getReadline()
#8 Command line code(39): Psy\Shell->__construct(Object(Psy\Configuration))
#9 {main}
  thrown in D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php on line 791

   Symfony\Component\ErrorHandler\Error\FatalError 

  Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP? in D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
Stack trace:
#0 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(257): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_exists(): ...', 'D:\\Gui\\Tecnolog...', 791)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(2, 'file_exists(): ...', 'D:\\Gui\\Tecnolog...', 791)
#2 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(791): file_exists('hoa://Library/T...')
#3 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(811): Psy\Readline\Hoa\ConsoleTput::getTerminfo()
#4 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Userland.php(43): Psy\Readline\Hoa\ConsoleTput::isSupported()
#5 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Configuration.php(822): Psy\Readline\Userland::isSupported()
#6 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Configuration.php(794): Psy\Configuration->getReadlineClass()
#7 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Shell.php(92): Psy\Configuration->getReadline()
#8 Command line code(39): Psy\Shell->__construct(Object(Psy\Configuration))
#9 {main}
  thrown

  at D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
    787▕         $fileAlpha = $term[0].\DIRECTORY_SEPARATOR.$term;
    788▕         $pathname = null;
    789▕ 
    790▕         foreach ($paths as $path) {
  ➜ 791▕             if (\file_exists($_ = $path.\DIRECTORY_SEPARATOR.$fileHexa) ||
    792▕                 \file_exists($_ = $path.\DIRECTORY_SEPARATOR.$fileAlpha)) {
    793▕                 $pathname = $_;
    794▕ 
    795▕                 break;


   Whoops\Exception\ErrorException 

  Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP? in D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
Stack trace:
#0 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(257): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_exists(): ...', 'D:\\Gui\\Tecnolog...', 791)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(2, 'file_exists(): ...', 'D:\\Gui\\Tecnolog...', 791)
#2 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(791): file_exists('hoa://Library/T...')
#3 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(811): Psy\Readline\Hoa\ConsoleTput::getTerminfo()
#4 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Userland.php(43): Psy\Readline\Hoa\ConsoleTput::isSupported()
#5 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Configuration.php(822): Psy\Readline\Userland::isSupported()
#6 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Configuration.php(794): Psy\Configuration->getReadlineClass()
#7 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Shell.php(92): Psy\Configuration->getReadline()
#8 Command line code(39): Psy\Shell->__construct(Object(Psy\Configuration))
#9 {main}
  thrown

  at D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
    787▕         $fileAlpha = $term[0].\DIRECTORY_SEPARATOR.$term;
    788▕         $pathname = null;
    789▕ 
    790▕         foreach ($paths as $path) {
  ➜ 791▕             if (\file_exists($_ = $path.\DIRECTORY_SEPARATOR.$fileHexa) ||
    792▕                 \file_exists($_ = $path.\DIRECTORY_SEPARATOR.$fileAlpha)) {
    793▕                 $pathname = $_;
    794▕ 
    795▕                 break;

  1   D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\filp\whoops\src\Whoops\Run.php:486
      Whoops\Run::handleError("Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP? in D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
Stack trace:
#0 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(257): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_exists(): ...', 'D:\\Gui\\Tecnolog...', 791)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(2, 'file_exists(): ...', 'D:\\Gui\\Tecnolog...', 791)
#2 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(791): file_exists('hoa://Library/T...')
#3 D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa...", "D:\Gui\Tecnologia_da_Informacao\Projetos_Atuais\centro-britanico\services\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php")

  2   [internal]:0
      Whoops\Run::handleShutdown()

*** Execution finished ***
                                

Same problem in my configuration:

Laravel Version: 8.83
PHP Version: 8.0.9
PhpStorm 2021.1.3
PHP Fatal error:  Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP? in C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_exists(): ...', 'C:\\Users\\Gui\\Ph...', 791)
#1 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(791): file_exists('hoa://Library/T...')
#2 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(811): Psy\Readline\Hoa\ConsoleTput::getTerminfo()
#3 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Userland.php(43): Psy\Readline\Hoa\ConsoleTput::isSupported()
#4 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Configuration.php(822): Psy\Readline\Userland::isSupported()
#5 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Configuration.php(794): Psy\Configuration->getReadlineClass()
#6 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Shell.php(92): Psy\Configuration->getReadline()
#7 Command line code(34): Psy\Shell->__construct(Object(Psy\Configuration))
#8 {main}
  thrown in C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php on line 791

   Symfony\Component\ErrorHandler\Error\FatalError 

  Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP? in C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_exists(): ...', 'C:\\Users\\Gui\\Ph...', 791)
#1 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(791): file_exists('hoa://Library/T...')
#2 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(811): Psy\Readline\Hoa\ConsoleTput::getTerminfo()
#3 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Userland.php(43): Psy\Readline\Hoa\ConsoleTput::isSupported()
#4 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Configuration.php(822): Psy\Readline\Userland::isSupported()
#5 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Configuration.php(794): Psy\Configuration->getReadlineClass()
#6 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Shell.php(92): Psy\Configuration->getReadline()
#7 Command line code(34): Psy\Shell->__construct(Object(Psy\Configuration))
#8 {main}
  thrown

  at C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
    787$fileAlpha = $term[0].\DIRECTORY_SEPARATOR.$term;
    788$pathname = null;
    789790foreach ($paths as $path) {
  ➜ 791if (\file_exists($_ = $path.\DIRECTORY_SEPARATOR.$fileHexa) ||
    792\file_exists($_ = $path.\DIRECTORY_SEPARATOR.$fileAlpha)) {
    793$pathname = $_;
    794795break;


   Whoops\Exception\ErrorException 

  Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP? in C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_exists(): ...', 'C:\\Users\\Gui\\Ph...', 791)
#1 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(791): file_exists('hoa://Library/T...')
#2 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(811): Psy\Readline\Hoa\ConsoleTput::getTerminfo()
#3 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Userland.php(43): Psy\Readline\Hoa\ConsoleTput::isSupported()
#4 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Configuration.php(822): Psy\Readline\Userland::isSupported()
#5 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Configuration.php(794): Psy\Configuration->getReadlineClass()
#6 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Shell.php(92): Psy\Configuration->getReadline()
#7 Command line code(34): Psy\Shell->__construct(Object(Psy\Configuration))
#8 {main}
  thrown

  at C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
    787$fileAlpha = $term[0].\DIRECTORY_SEPARATOR.$term;
    788$pathname = null;
    789790foreach ($paths as $path) {
  ➜ 791if (\file_exists($_ = $path.\DIRECTORY_SEPARATOR.$fileHexa) ||
    792\file_exists($_ = $path.\DIRECTORY_SEPARATOR.$fileAlpha)) {
    793$pathname = $_;
    794795break;

  1   C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\filp\whoops\src\Whoops\Run.php:486
      Whoops\Run::handleError("Uncaught ErrorException: file_exists(): Unable to find the wrapper "hoa" - did you forget to enable it when you configured PHP? in C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php:791
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_exists(): ...', 'C:\\Users\\Gui\\Ph...', 791)
#1 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(791): file_exists('hoa://Library/T...')
#2 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php(811): Psy\Readline\Hoa\ConsoleTput::getTerminfo()
#3 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Userland.php(43): Psy\Readline\Hoa\ConsoleTput::isSupported()
#4 C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Configurati...", "C:\Users\Gui\PhpstormProjects\GSFERRO\walter\LEITOR PDF\leitor-pdf\vendor\psy\psysh\src\Readline\Hoa\ConsoleTput.php")

  2   [internal]:0
      Whoops\Run::handleShutdown()
*** Execution finished ***

ConsoleTput.php file, for me it wasn't opening tinker. Fixed it with commenting and adding the location of the terms file on my local windows machine:
image

anyone else with a better solution? I'll not modify my vendor folder.

Excuse me for the lack of response - I'm not dead, covid happened :(

I'm going to look at this soon, currently in the process of upgrading another project.

I tested this with:

  • Laravel version: 8.83 / PHP Version: 8.0.9 / PhpStorm 2021.1.3
  • Laravel Version: 9.19.0 / PHP Version: 8.1.3 / PhpStorm 2022.1.2

Both instances working just fine here. So, it's not a bug that has something to do with Laravel version, PHP version or PHPStorm version. Please add all of the questions asked under "Environment" of the bug template. I don't put them there for the fun of it - I want to exactly replicate your bug. Here is a reminder:

  • IDE & Version: [e.g. PHPStorm 2020.2.1]
  • PHP Version: [e.g. 7.4] (Find out with php -v)
  • OS: [e.g. Windows 10, macOS 10.15, Ubuntu 20.04]
  • Laravel Tinker plugin version : [e.g. 1.1.1]
  • Interpreter Type: (One of the following: Local / Remote / Docker / Docker-compose)
  • Laravel Version: [e.g. 7.3.0] (Find out with composer show laravel/framework)
  • Tinker version: [e.g. 2.3.0] (Find out with composer show laravel/tinker)

Hey @Roboroads seems to be an psy/psysh issue.
Look this bobthecow/psysh#722

I solved my problem downgrading psy/psysh to "0.11.2"

I forgot this was the issue, yes, thanks.

Workaround available in #164 (comment)

This has been resolved in v0.11.8. Please update!