LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-08-2008, 07:08 AM   #1
vbsaltydog
Member
 
Registered: Nov 2005
Distribution: CentOS
Posts: 154

Rep: Reputation: 15
DOM in PHP?


I am trying to use the DOM functions in PHP and when I try to run the php code I get the following complaint:

Cannot instantiate non-existent class: domdocument

Which I thought meant that I needed to recompile PHP with dom but here is my php info which has the --with-dom option

Code:
'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd=shared' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses=shared' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mime-magic=/usr/share/file/magic.mime' '--with-apxs2=/usr/sbin/apxs'
I have also never recompiled php before and don't know where to run the ./configure command from. The php instance was built during the OS install so I dont know where the source files are.

Any help is appreciated.
 
Old 06-09-2008, 05:39 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,356

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Hi

Just make sure you are using PHP5 and not PHP4. If I were you, I'd look in the package management of CentOS to see if there is PHP5 support. (Sorry but I don't know CentOS.) You don't have to compile your own PHP. This is a standard part of PHP5, but it's not in PHP4.
 
Old 06-09-2008, 09:01 AM   #3
vbsaltydog
Member
 
Registered: Nov 2005
Distribution: CentOS
Posts: 154

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by vbsaltydog View Post
I am trying to use the DOM functions in PHP and when I try to run the php code I get the following complaint:

Cannot instantiate non-existent class: domdocument

I have also never recompiled php before and don't know where to run the ./configure command from. The php instance was built during the OS install so I dont know where the source files are.

Any help is appreciated.
I couldn't recompile php because it was installed using an rpm. I did use yum to upgrade php 4 to php 5 but the Centos php 5 rpm is installed with the --disable-dom option so I had to install two rpm's using yum in addition to php 5. The two additional rpm's are php-xml and php-xmlrpc for the version that matches your php install. After that, parsing xml files with the DOM functions of php work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php 5 - centos 4 - enabling dom mcupples Linux - Server 7 09-06-2007 03:07 AM
Enable DOM with PHP janhouse00 Linux - Server 1 04-23-2007 04:09 AM
php with DOM suport bm1 Linux - Software 0 05-17-2004 08:32 AM
how to recompile php to activate --with-dom phamtranquocvie Linux - Newbie 8 03-16-2004 01:17 PM
XML php dom amirspl Programming 2 09-20-2003 07:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration