Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
asgrim opened this issue Dec 2, 2024 · 0 comments · Fixed by #158
Closed

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

asgrim opened this issue Dec 2, 2024 · 0 comments · Fixed by #158
Assignees
Labels
bug Something isn't working
Milestone

Comments

@asgrim
Copy link
Collaborator

asgrim commented Dec 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant