XMLReader will not compile from PECL

I am using the Virtualmin bleeding edge repo to run the latest version of PHP you guys make available. I am trying to get xmlreader installed, and there does not appear to be an RPM available for it. When trying to install via PECL it fails:

/tmp/pear/download/xmlreader-1.0.1/php_xmlreader.c: In function 'xmlreader_objects_new': /tmp/pear/download/xmlreader-1.0.1/php_xmlreader.c:349: error: 'zend_object' has no member named 'in_get' /tmp/pear/download/xmlreader-1.0.1/php_xmlreader.c:350: error: 'zend_object' has no member named 'in_set' make: *** [php_xmlreader.lo] Error 1 ERROR: `make' failed

Do you guys have an RPM available to get xmlreader enabled... or is there another way around this that I am not aware of? I wouldn't expect it to fail though since I am not running any "extras" outside of the RPM's made available from your repo.

Status: 
Active

Comments

The XMLReader extension is actually something available in the core PHP as of PHP 5.1.x. Can you verify that XMLReader isn't already available on your system?

You can determine that by calling a script that runs the phpinfo(); function -- and look for the text "xmlreader" in that.

Hello,

I can indeed. It was never enabled from the RPM's I installed from the Virtualmin repo, hence I was trying to add it through PECL:

[root@backbone ~]# php -i | grep --color -i reader Configure Command => './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-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/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--enable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-ncurses=shared' '--with-gd=shared' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--enable-dom=shared' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--enable-fastcgi' '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--with-readline' '--enable-dbase=shared' '--with-pspell=shared' '--with-mcrypt=shared,/usr' '--with-mhash=shared,/usr' '--with-tidy=shared,/usr' '--with-mssql=shared,/usr' [root@backbone ~]#

You can see that the configure string has --enable-xmlreader=shared, but there's nothing else after it regarding version numbers or anything. Software that requires it is failing, saying that it is not available.

Link to phpinfo(): http://www.righttorule.com/info.php

Well, two things.

First, it looks like the ./configure output you're sharing above, and the phpinfo() output in your link, are different :-)

Second, setting a module as "shared" means that it'll be compiled as a module, rather than compiling it into the main PHP binary. All that means is that you'd need to load the module that was compiled, it won't be done automatically.

So, in your php.ini file, try adding a line like this:

extension=xml.so

Ah, I misunderstood what "shared" meant! Sorry!

That is very strange though that the configure command is different. There's only one php binary on the system:

[root@backbone modules]# which php
/usr/bin/php
[root@backbone modules]#

The extensions directory unfortunately does not have anything named xml.so in it:

[root@backbone modules]# php -i | grep extension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules

[root@backbone modules]# ls
dbase.so mbstring.so odbc.so pdo.so snmp.so zip.so
gd.so mcrypt.so pdo_mysql.so pdo_sqlite.so ssh2.so
imap.so mysqli.so pdo_odbc.so pgsql.so xcache.so
json.so mysql.so pdo_pgsql.so phpcups.so xmlrpc.so

[root@backbone modules]# pwd
/usr/lib64/php/modules

I do see that in the phpinfo() page I provided it shows xmlreader being compiled as "disabled". Would that have something to do with the module not being available, even though supposedly the PHP CLI shows it as being compiled?

What output do you get if you type this:

find /usr -name "xml.so"

You may want to make sure you've installed the php-xml package, as it would be what contains the xmlreader support.

Hey good call, that did it!

Thanks so much!