Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

4 Answers

up vote 11 down vote accepted

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.

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. –  AlberT Sep 17 '09 at 10:37
    
Are you sure you have loaded the extendsion in your php.ini and restarted apache too ? –  AlberT 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
1  
For anyone that comes across this and installed the IUS php53 package, you would install php53-xml. –  Jonathan Haddad Jul 21 '10 at 20:25
show 4 more comments

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
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. –  AlberT Sep 17 '09 at 10:34
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.