Bug 32209 - DOM support is not enabled
Summary: DOM support is not enabled
Status: NEW
Alias: None
Product: Branch p7
Classification: Distributions
Component: php5-libs (show other bugs)
Version: не указана
Hardware: all Linux
: P3 normal
Assignee: Andrey Cherepanov
QA Contact: qa-p7@altlinux.org
URL:
Keywords:
Depends on: 32210
Blocks:
  Show dependency tree
 
Reported: 2016-06-22 12:16 MSK by Yuriy Kashirin
Modified: 2016-06-22 13:41 MSK (History)
0 users

See Also:


Attachments
патч для пересборки php с встроенным модулем dom (1.39 KB, patch)
2016-06-22 12:16 MSK, Yuriy Kashirin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuriy Kashirin 2016-06-22 12:16:24 MSK
Created attachment 6756 [details]
патч для пересборки php с встроенным модулем dom

При вызове XMLReader::expand() в коде PHP выводится предупреждение "DOM support is not enabled", функция возвращает null.

При этом пакет php5-dom установлен, phpinfo() показывает, что расширение DOM присутствует, разрешено:

$ rpm -q php5-libs
php5-libs-5.5.24-alt0.M70P.1

$ rpm -q php5-dom
php5-dom-5.5.24.20150415-alt1

$ php -r 'phpinfo();' | grep -A6 DOM
DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.9.2
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled


$ php -r '$xml = new XMLReader(); $xml->XML("<root/>"); $xml->read(); $obj = $xml->expand();'
PHP Warning:  DOM support is not enabled in Command line code on line 1



Проявляется на p7, но судя по всему, это актуально для всех веток.

Проблема сидит в коде php - проверка доступности DOM в модуле xmlreader выполняется во время компиляции:
PHP_METHOD(xmlreader, expand)
{
#ifdef HAVE_DOM
....
#else
    php_error(E_WARNING, "DOM support is not enabled");
    return;
#endif
}

При этом у нас модуль xmlreader собран вместе с php5-libs, а dom вынесен в отдельный модуль.

Проблему решает, например, пересборка php5 с --enable-dom (патч на спек в аттаче).
Другой вариант - сделать как центосе. Там xml модули, включая xmlreader и dom, собраны отдельными модулями, но собираются все вместе в один пакет php-xml