You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I start VSCode, once extension boots up i got this error:
`
2025-01-20 10:08:32.513 [error] Error:
'""No' is not recognized as an internal or external command,
operable program or batch file.
2025-01-20 10:08:32.513 [error] ""No usable PHP version found"" "c:\inetpub\wwwroot\mhv\vendor_laravel_ide\discover-3e2e90ed831bcc0de1ed14119ef5173f.php"
2025-01-20 10:08:32.513 [error] '""No' is not recognized as an internal or external command,
operable program or batch file.
2025-01-20 10:08:32.513 [error] Error:
'""No' is not recognized as an internal or external command,
operable program or batch file.
2025-01-20 10:08:32.513 [error] ""No usable PHP version found"" "c:\inetpub\wwwroot\mhv\vendor_laravel_ide\discover-901610af9ad0957af18489de07ea4347.php"
2025-01-20 10:08:32.513 [error] '""No' is not recognized as an internal or external command,
operable program or batch file.
I had to set the PHP environment to 'local' (ensure the PHP path is added to the environment variables on Windows). If the PHP environment setting is set to auto-detect, it will check 'local' last and fail (timeout?). I don't use Herd because adding additional PHP extensions don't work on my Windows/Herd machine, so my remaining options are 'local' or docker.
Extension Version
0.1.18
PHP Binary
Local PHP
Operating System
Windows
What happened?
I start VSCode, once extension boots up i got this error:
`
2025-01-20 10:08:32.513 [error] Error:
'""No' is not recognized as an internal or external command,
operable program or batch file.
2025-01-20 10:08:32.513 [error] ""No usable PHP version found"" "c:\inetpub\wwwroot\mhv\vendor_laravel_ide\discover-3e2e90ed831bcc0de1ed14119ef5173f.php"
2025-01-20 10:08:32.513 [error] '""No' is not recognized as an internal or external command,
operable program or batch file.
2025-01-20 10:08:32.513 [error] Error:
'""No' is not recognized as an internal or external command,
operable program or batch file.
2025-01-20 10:08:32.513 [error] ""No usable PHP version found"" "c:\inetpub\wwwroot\mhv\vendor_laravel_ide\discover-901610af9ad0957af18489de07ea4347.php"
2025-01-20 10:08:32.513 [error] '""No' is not recognized as an internal or external command,
operable program or batch file.
2025-01-20 10:08:32.513 [info] Activating Laravel Extension...
2025-01-20 10:08:32.513 [info] Started`
PHP file content:
`<?php
error_reporting(E_ERROR | E_PARSE);
define('LARAVEL_START', microtime(true));
require_once DIR . '/../autoload.php';
$app = require_once DIR . '/../../bootstrap/app.php';
class VsCodeLaravel extends \Illuminate\Support\ServiceProvider
{
public function register()
{
}
}
function vsCodeToRelativePath($path)
{
if (!str_contains($path, base_path())) {
return (string) $path;
}
}
$app->register(new VsCodeLaravel($app));
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();
echo 'VSCODE_LARAVEL_START_OUTPUT';
function vsCodeFindBladeFiles($path)
{
$paths = [];
if (!is_dir($path)) {
return $paths;
}
foreach (
\Symfony\Component\Finder\Finder::create()
->files()
->name("*.blade.php")
->in($path)
as $file
) {
$paths[] = [
"path" => str_replace(base_path(DIRECTORY_SEPARATOR), '', $file->getRealPath()),
"isVendor" => str_contains($file->getRealPath(), base_path("vendor")),
"key" => \Illuminate\Support\Str::of($file->getRealPath())
->replace(realpath($path), "")
->replace(".blade.php", "")
->ltrim(DIRECTORY_SEPARATOR)
->replace(DIRECTORY_SEPARATOR, ".")
];
}
return $paths;
}
$paths = collect(
app("view")
->getFinder()
->getPaths()
)->flatMap(function ($path) {
return vsCodeFindBladeFiles($path);
});
$hints = collect(
app("view")
->getFinder()
->getHints()
)->flatMap(function ($paths, $key) {
return collect($paths)->flatMap(function ($path) use ($key) {
return collect(vsCodeFindBladeFiles($path))->map(function ($value) use (
$key
) {
return array_merge($value, ["key" => "{$key}::{$value["key"]}"]);
});
});
});
[$local, $vendor] = $paths
->merge($hints)
->values()
->partition(function ($v) {
return !$v["isVendor"];
});
echo $local
->sortBy("key", SORT_NATURAL)
->merge($vendor->sortBy("key", SORT_NATURAL))
->toJson();
;
echo 'VSCODE_LARAVEL_END_OUTPUT';
exit(0);
`
The text was updated successfully, but these errors were encountered: