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
Fresh Contao installation -> XMLReader::open(): Argument #1 ($uri) must not contain any null bytes #5832
Comments
Can you please test what the output of the following PHP code is on your system? var_dump((new \XMLReader)->open('compress.zlib://data:text/xml,<x/>')); |
The output is |
This is definitely a PHP 8.2.3 issue. |
This is intresting, because that code is exactly whats happening on line 216 in Image.php.
So the output for PHP 8.2.3 is not |
Line 216 is
Output for both, php 8.1.16 and php 8.2.3 is The error also occurs in Contao 5.1.0 (error with php 8.2.3, no error with php 8.1.16). Additional notes: |
You wrote
and
So which is it for PHP 8.2, |
On the CLI |
I’m not able to reproduce the var_dump((new \XMLReader)->open('data:text/xml,<x/>'));
var_dump((new \XMLReader)->open('data:text/xml;base64,PHgvPg=='));
$file = tempnam(sys_get_temp_dir(), 'xml');
file_put_contents($file, '<x/>');
var_dump((new \XMLReader)->open($file)); |
I am running this on an nginx server.
|
Very strange. It seems like the One last test code to execute please: var_dump(file_get_contents('data:text/xml;base64,PHgvPg=='));
var_dump(file_get_contents('data:text/xml,<x/>')); If this does not output |
The output of
is
|
@ausi the error still persists with php 8.2.5 (on a fresh contao 4.13 installation). |
Yes, I think this would make sense. You can point them to https://3v4l.org/djBF9 that shows this example code works without errors in other PHP setups. |
This seems to be an issue with older The packages provided by @oerdnj / https://deb.sury.org/ also have this problem, which is not surprising as he is or at least was a Debian Developer/Packager A self-compiled PHP 8.2 with |
I don’t think it is related to libxml version 2.9.4 as 3v4l.org uses the same version, see https://3v4l.org/3NCuc @macearl what is the output of the following code snippet on your system? <?php
echo "libxml ".LIBXML_DOTTED_VERSION."\n\n";
var_dump((new \XMLReader)->open('data:text/xml,<x/>'));
var_dump((new \XMLReader)->open('data:text/xml;base64,PHgvPg==')); |
mmh it seems I did not Check the Version from sury correctly, as it also uses the newer
Here on a buster machine (I did not compile another version for this one):
And on a bookworm host, which by default uses a newer
|
@macearl I think you could report this as a PHP bug then: https://github.com/php/php-src/issues/new/choose |
@macearl we are using "Debian GNU/Linux 10 (buster)". |
We were also experiencing this issue and have found a possible solution. Disabling the flag |
/cc @beberlei just FYI, Benjamin, in case you haven't heard of this issue in Tideways yet. Maybe it's also something that has been fixed already in a later version? :) |
Disabling That also explains why it worked on our bookworm host as that is the only system without Tideways. |
@Toflar thanks for the ping, this is a known issue in PHP Observer API itself starting with PHP 8.2.0. It will crash with any extension using the observer API. The fix will be included in PHP 8.2.9 See php/php-src@cad47be |
Thank you so much for the feedback! ❤️ So updating to the upcoming PHP version 8.2.9 should fix the problem for everybody 😊 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Affected version(s)
4.13.16
5.1.0
Description
I just installed Contao 4.13.16 via Contao Manager (PHP 8.2.3).
When clicking on any menu item in the backend (e.g. Articles), I get an internal server error:
XMLReader::open(): Argument #1 ($uri) must not contain any null bytes
Stack Trace (Debug modus ON):
Exception ValueError in [vendor/contao/image/src/Image.php ](https://abc.tld/_profiler/open?file=vendor/contao/image/src/Image.php&line=216#line216)(line 216) Symfony Exception [Symfony Docs](https://symfony.com/doc/5.4.21/index.html) [UndefinedFunctionError](https://abc.tld/contao?do=files&ref=fPU9t8Ir#trace-box-1) HTTP 500 Internal Server Error Attempted to call function "highlight_file" from namespace "Symfony\Component\ErrorHandler\ErrorRenderer". Did you mean to call "\safe\highlight_file"? Exception Symfony\Component\ErrorHandler\Error\ UndefinedFunctionError in [/var/www/web/vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php ](https://abc.tld/contao?do=files&ref=fPU9t8Ir)(line 271)
The text was updated successfully, but these errors were encountered: