Created attachment 218281 [details] File to test the issue On php74 with the extensions php74-dom and php74-xmlreader enabled, certain php functions will result in a warning "PHP Warning: DOM support is not enabled". If php74 is built with the "--enable-dom" and "--enable-xmlreader" configuration arguments and the two extensions are not installed, these functions work without a warning. On other php versions it works without the arguments and on other operating systems php74 works too. To test this, execute the attached file. See also: https://github.com/awesomemotive/one-click-demo-import/issues/207
I am afraid i can't follow or replicate this description at the moment. So please help me to understand: * You installed lang/php74? Via pkg? * You also installed textproc/php74-dom via pkg? If so, it works great for me. :D Because installing textproc/php74-dom is exactly using "--enable-dom" as configure flag for PHP 7.4. If this still fails i need: * the specific functions used which issues a warning? * The output of "php -m" * The output of pkg info | grep php The link describes a wrong usages of the PHP modules. A simple "pkg install textproc/php74" is enough to get it work! :)
The expansion is independent. DOM exists in textproc/php74-dom. XMLREADER exists in textproc/php74-xmlreader. If you install lang/php74-extensions, they are installed by default. if php74-dom and php74-xmlreader are already installed, they are enabled in the ini of --with-config-file-scan-dir. --with-config-file-scan-dir is ${PREFIX}/etc/php. It is usually /usr/local/etc/php. But that can be overridden by the environment variable PHP_INI_SCAN_DIR. If result of php -r 'var_dump(php_ini_scanned_files());' does not include ext-20-dom.ini, something is wrong.
(In reply to Torsten Zuehlsdorff from comment #1) I installed php74, php74-dom and php74-xmlreader via pkg. Then i executed the attached script. This generated the warning. The function that causes the warning is expand() from the class XMLReader, which is provided by the xmlreader extension. Additional infos: php -m [PHP Modules] Core date dom hash libxml mysqlnd pcre Reflection SPL standard xmlreader [Zend Modules] pkg info | grep php php74-7.4.10 PHP Scripting Language php74-dom-7.4.10 The dom shared extension for php php74-xmlreader-7.4.10 The xmlreader shared extension for php
I came here to report the same problem but see it already exists (didn't find this page when I was trying to diagnose the error in the first place....) php73-xmlreader lists php73-dom as a build dependency. php74-xmlreader does not. I'm not sure why but it seems something has changed that has caused the xmlreader module to be built without --with-dom enabled. This isn't simply a case of requiring the pkg. Even having both php74-dom and php74-xmlreader installed doesn't work as the xmlreader module needs to be able to see the dom module at build time.* ---------------------------- 1108 /* {{{ proto bool XMLReader::expand() 1109 Moves the position of the current instance to the next node in the stream. */ 1110 PHP_METHOD(xmlreader, expand) 1111 { 1112 #ifdef HAVE_DOM ... 1150 #else 1151 php_error(E_WARNING, "DOM support is not enabled"); 1152 return; 1153 #endif ---------------------------- Unfortunately this causes various applications to break (A Wordpress theme brought it to my attention but there are other reports on the Internet). The only option to use 7.4 is to build from source which isn't really ideal.
I am also having issues with this bug, some more information on the forums here: https://forums.freebsd.org/threads/php-7-4-dom-support-not-enabled.77228/
Thank you all for the additional explanation! :) I see what you mean. Will check how to fix it :)
A commit references this bug: Author: tz Date: Thu Oct 8 21:08:00 UTC 2020 New revision: 551733 URL: https://svnweb.freebsd.org/changeset/ports/551733 Log: lang/php74: Add missing dependency from php74-xmlreader to php74-dom xmlreader needs not only the DOM extension, but to be compiled with --enabled-dom. This commit adds the missing configuration to etablish the dependency. PR: 249886 Submitted by: michael.glaus@hostpoint.ch Sponsored by: Bounce Experts Changes: head/lang/php74/Makefile.ext
A commit references this bug: Author: tz Date: Thu Oct 8 21:16:39 UTC 2020 New revision: 551734 URL: https://svnweb.freebsd.org/changeset/ports/551734 Log: MFH: r551733 lang/php74: Add missing dependency from php74-xmlreader to php74-dom xmlreader needs not only the DOM extension, but to be compiled with --enabled-dom. This commit adds the missing configuration to etablish the dependency. PR: 249886 Submitted by: michael.glaus@hostpoint.ch Sponsored by: Bounce Experts Approved by: ports-secteam (joneum, implicit for PHP Updates) Changes: _U branches/2020Q4/ branches/2020Q4/lang/php74/Makefile.ext
This shoud be fixed now. I also merged it into the quarterly branch :)
Thank you for the fix. It works for my issue.