Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 12 down vote accepted

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

You can find a list of downloads at

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


and restart apache.

share|improve this answer
Looks like installing php-xml does the trick for dompdf. It is now creating the pdf, but the error is still there. – Randell Sep 17 '09 at 10:36
please edit your post adding some output. Detail the error you got. – drAlberT Sep 17 '09 at 10:37
Are you sure you have loaded the extendsion in your php.ini and restarted apache too ? – drAlberT Sep 17 '09 at 10:38
I'm getting the same error, but the pdf is now being created. I haven't modified php.ini yet. Which extension do I need to load in php.ini? – Randell Sep 17 '09 at 10:39
For anyone that comes across this and installed the IUS php53 package, you would install php53-xml. – Jon Haddad Jul 21 '10 at 20:25

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.

share|improve this answer
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

I installed php-xml with YUM (CentOS)

sudo yum install php-xml

Restart Apache

sudo service httpd restart

Everything works fine

share|improve this answer
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

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.