9

From the output of phpinfo(), --disable-dom are included the configure command. How do I change it to --enable-dom without recompiling PHP?

Edit: I'm using Fedora 10. The PHP i'm using is the one that came with it.

drAlberT
  • 10,999
  • 7
  • 40
  • 52
Randell
  • 1,203

4 Answers4

12

Just install the package named php-xml, which provides the php-dom support.

You can find a list of downloads at http://rpm.pbone.net/index.php3/stat/4/idpl/10503222/com/php-xml-5.2.6-5.i386.rpm.html

Make sure to adjust configs in order to actually load the modules:

/etc/php.d/dom.ini
/etc/php.d/xmlreader.ini
/etc/php.d/xmlwriter.ini
/etc/php.d/xsl.ini

and restart apache.

drAlberT
  • 10,999
  • 7
  • 40
  • 52
3

You cannot - these are compile-time options.

Unless you find another pre-compiled PHP distribution that is compatible with your setup (which you don't detail in your question).

Unless of course the functions that you are looking for are implemented in other ways too, say a set of functions in a php script file that you can include() into your scripts.

  • 2
    You can simply search a package that provide it as a shared object. Every modern distribution has such a package for a great number of PHP extensions. – drAlberT Sep 17 '09 at 10:34
2

I installed php-xml with YUM (CentOS)

sudo yum install php-xml

Restart Apache

sudo service httpd restart

Everything works fine

  • Note that if you have PHP 5.3 installed, you may need to use this instead: sudo yum install php53-xml – Matt Browne Jul 11 '13 at 20:26
  • In my case there was also an issue with the php-common dependency not being met (wrong version I guess?). The following commands fixed it: `$ rpm -e --nodeps php-common

    warning: /etc/php.ini saved as /etc/php.ini.rpmsave

    $ yum install php53-xml

    restore the original php.ini

    $ cp /etc/php.ini.rpmsave /etc/php.ini`

    – Matt Browne Jul 11 '13 at 20:28
0

you could download the SRPM for PHP. Change the spec file so that it has --enable-dom then remake the RPM using rpmbuild tools.

See This Site as an example of patching and rebuild a SRPM.

Wayne
  • 3,104