Bug #81694 [Nab]: DOMDocument is not available on 7.4 with configure --disable-all --with-libxml
| From: | requinix@php.net | Date: | Fri, 03 Dec 2021 17:36:03 +0000 |
| Subject: | Bug #81694 [Nab]: DOMDocument is not available on 7.4 with configure --disable-all --with-libxml | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-238151@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81694&edit=1
ID: 81694
Updated by: requinix@php.net
Reported by: divinity76 at gmail dot com
Summary: DOMDocument is not available on 7.4 with configure
--disable-all --with-libxml
Status: Not a bug
Type: Bug
Package: DOM XML related
Operating System: Amazon Linux 2 (RHEL-like)
PHP Version: 7.4.26
Block user comment: N
Private report: N
New Comment:
> -disable-all isn't suppose to disable following things that are explicitly enabled,
libxml is not the DOM extension. It is the underlying library used to power PHP's multiple DOM
and XML-based extensions. Enabling DOM implies enabling libxml, but enabling libxml does not imply
enabling DOM.
Previous Comments:
------------------------------------------------------------------------
[2021-12-03 17:06:56] cmb@php.net
> wonder if --enable-dom should be explicitly mentioned
If at all, then there could be general info about that. If there
is --enable-*, then there is automatically --disable-*, and vice
versa. Same for --with-* and --without-*.
------------------------------------------------------------------------
[2021-12-03 16:44:06] divinity76 at gmail dot com
@requinix sure, but --disable-all isn't suppose to disable following things that are explicitly
enabled, for example if you do
./configure --disable-all --with-curl then you still get
a php with curl_*
@cmb indeed --enable-dom fixed the issue! thanks! wonder if --enable-dom should be explicitly
mentioned on https://www.php.net/manual/en/dom.installation.php
------------------------------------------------------------------------
[2021-12-03 15:41:42] cmb@php.net
Add --enable-dom.
------------------------------------------------------------------------
[2021-12-03 15:21:00] requinix@php.net
You said to --disable-all. That does exactly what it sounds like it does.
------------------------------------------------------------------------
[2021-12-03 15:12:24] divinity76 at gmail dot com
Description:
------------
when compiling PHP7.4 like this:
rm -rf php-src && \
git clone -b 'PHP-7.4' --depth 1 https://github.com/php/php-src.git && \
cd 'php-src' && \
./buildconf && \
./configure --disable-all --disable-cgi --enable-cli --with-libxml && \
make clean && \
make -j $(nproc) && \
rm -rfv ../php && \
cp -v ./sapi/cli/php ../php
the resulting php binary does not have DOMDocument available.. i'm pretty sure DOMDocument is
supposed to be there when --with-libxml is provided? i guess its a bug with the combo --disable-all
+ --with-libxml ?
Test script:
---------------
./php -r 'new DOMDocument;'
Expected result:
----------------
(blank)
Actual result:
--------------
[root@ip-192-168-1-1 php]# cat compile_bugreport.sh
yum install autoconf bison re2c libxml2 gcc && \
rm -rf php-src && \
git clone -b 'PHP-7.4' --depth 1 https://github.com/php/php-src.git && \
cd 'php-src' && \
./buildconf && \
./configure --disable-all --disable-cgi --enable-cli --with-libxml && \
make clean && \
make -j $(nproc) && \
rm -rfv ../php && \
cp -v ./sapi/cli/php ../php
[root@ip-192-168-1-1 php]# ./php -r 'new DOMDocument;'
Fatal error: Uncaught Error: Class 'DOMDocument' not found in Command line code:1
Stack trace:
#0 {main}
thrown in Command line code on line 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81694&edit=1