在从源代码编译php7.4时,如何获得DOMDocument?我在Amazon 2上编译php7.4,如下所示:
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-curl --with-libxml && \
make clean && \
make -j $(nproc) && \
rm -rfv ../php && \
cp -v ./sapi/cli/php ../php令我惊讶的是,结果php二进制文件没有可用的DOMDocument:
[root@ip-192-168-84-98 php]# ./php test.php
Fatal error: Uncaught Error: Class 'DOMDocument' not found in /hans_temp/php/test.php:558
Stack trace:
#0 /hans_temp/php/test.php(573): get_gps_coordiates_from_finn_id('237587045')
#1 {main}
thrown in /hans_temp/php/test.php on line 558我以为-libxml应该添加DOMDocument,但这里没有.我可以从理论上推断,在--disable-all和--with-libxml标志之间存在一个bug --或者说,我缺少了一些DOMDocument支持,帮助?(fwiw --with-curl工作得很好,添加了curl_* api)
config.log:https://termbin.com/18i8 (太大了,无法在stackoverflow.com上内联)
发布于 2021-12-03 16:49:05
使用--禁用-all编译时,需要--with-libxml和--enable-dom才能使DOMDocument可用。
./configure --disable-all --enable-cli --with-libxml --enable-domhttps://stackoverflow.com/questions/70195898
复制相似问题