Skip to content

[Bug]: Checking local PHP installation fails in Windows #365

@livelogic

Description

@livelogic

Extension Version

1.0.7

PHP Binary

Local PHP

Operating System

Windows

What happened?

The command issued by the extension to detect the PHP environment fails in Windows:

[info] Checking local PHP installation: php -r 'echo PHP_BINARY;'
[info] Falling back to system PHP installation

It's been found (see issue #145) that the culprit is this block of code in extensions,js:

  options.set("local", {
    check: "php -r 'echo PHP_BINARY;'",
    command: `"{binaryPath}"`
  });

The reason is that in Windows the single quotes are not a valid delimiter for the nested command.
But double quotes are valid in both Windows and Linux, so this can be fixed by replacing the line with:

check: 'php -r "echo PHP_BINARY;"'

This has been tested as a workaround as reported here.

Mimimal Code Sample

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions