Skip to content

PHP startup warnings in target PHP result in InvalidPhpBinaryPath exception #146

Closed
@asgrim

Description

@asgrim

How to reproduce:

  • modify your php.ini to load an extension that does not exist, e.g. extension=blah
  • try to run any PIE operation that uses that target PHP to whom the php.ini belongs to

What should happen:

  • \Php\Pie\Platform\TargetPhp\PhpBinaryPath::assertValidLookingPhpBinary should not throw an exception

What actually happens:

  • the exception is raised in \Php\Pie\Platform\TargetPhp\Exception\InvalidPhpBinaryPath::fromInvalidPhpBinary

Additional information:

The output from the "valid-looking PHP" check is different. We expect simply the string PHP, but we see:

Warning: PHP Startup: Unable to load dynamic library 'blah' (tried: <redacted bunch of stuff it tried>) in Unknown on line 0
PHP

Hints; would be worth checking if the warning goes to stderr; this may help us easily filter out the warning (rather than doing some kind of string-based filtering) as then we can just check stderr output is exactly the string "PHP" in the check.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions