Open milibopp opened 3 years ago
What is the status of this issue ? The linked gist does not exist anymore.
Fixed the link. (I have changed my GitHub handle, and thus it broke.)
Is the issue still valid ?
Yes, the problem still exists.
This happens because the xml
extension is built-in to the php base package already. IIRC, it had to be built with the base for pear support to work. The easiest solution should be to just not include it in the extension list at all.
Not really the same issue but PHP scripts using the Composer XdebugHandler
component to disable the xdebug extension at runtime (like PHPStan or Infection PHP) will load PHP extensions twice.
As demonstrated here : https://gist.github.com/guillemcanal/92f4a97bb31d25522a9a7658a5ff5019
This is caused by the Bash wrapper script created by Nix which export PHP_INI_SCAN_DIR
with a fixed value.
A good fix for this issue, would be to check if PHP_INI_SCAN_DIR
was already provided.
Here's an example for /nix/store/zn50wlrf73ff12w88ynvha3y0bp7ydpm-php-with-extensions-8.1.1/bin/php
#! /nix/store/iqprjr5k5385bhf1dzj07zwd5p43py1n-bash-5.1-p12/bin/bash -e
export PHP_INI_SCAN_DIR="${PHP_INI_SCAN_DIR:-"/nix/store/zn50wlrf73ff12w88ynvha3y0bp7ydpm-php-with-extensions-8.1.1/lib"}"
"/nix/store/zn50wlrf73ff12w88ynvha3y0bp7ydpm-php-with-extensions-8.1.1/bin/.php-wrapped" "$@"
I added the steps to quickly reproduce the issue locally in the gist.
Describe the bug Some PHP environments create warnings like these:
To Reproduce Steps to reproduce the behavior:
php -r ""
, for example.Here is a flake-based gist to help reproduce it.
Expected behavior No warnings should appear.
Additional context This makes it impossible to run a somewhat older Symfony 3.x project of ours. I get warnings about every extension installed and errors about undefined names like this one, when actually trying to run code.
Notify maintainers @globin @talyz