laravel / forge-cli

The Laravel Forge CLI.
MIT License
226 stars 35 forks source link

Error during `forge ssh:configure` #16

Closed ethanclevenger91 closed 3 years ago

ethanclevenger91 commented 3 years ago

Description:

Fatal error. VSCode automatically opened laravel\forge-cli\scripts\keysFactory.php.

Steps To Reproduce:

ethanclevenger91 commented 3 years ago

Attempted the above picking the server by number instead of by server name. Same error, but got an additional error:

[22908:0806/114026.335:ERROR:broker_win.cc(56)] Error reading broker pipe: The pipe has been ended. (0x6D)

nunomaduro commented 3 years ago

I don't have a way to test this. If more customers report this issue, I will take a deep look.

ethanclevenger91 commented 3 years ago

Working to debug this by running the uncompiled source. Same error, but with some actual context to where it's happening:

41▕             : dirname($phar, 2);
     42▕
     43▕         $keys = json_decode(exec($basePath.'/scripts/keysFactory.php'), true);
     44▕
  ➜  45▕         File::put($this->keysPath.'/'.$this->privateKeyName($name), $keys['private']);
     46▕         File::put($this->keysPath.'/'.($localName = $this->publicKeyName($name)), $keys['public']);
     47▕
     48▕         return [$localName, $keys['public']];
     49▕     }

I'll just put together a PR once I've finished.

ethanclevenger91 commented 3 years ago

Alright, so if you have VSCode configured to handle PHP files on Windows, apparently the exec statement in line 43 above just opens VSCode instead of actually exec-ing the file. I set the default file handler for PHP files to the PHP executable on my system, which allowed the command to work.

But then I'm getting the results that #18 is getting, so I'll pick things up there.