Re: issues re: installing pyrus by following the online manual

From: Date: Sun, 28 Feb 2010 17:16:48 +0000
Subject: Re: issues re: installing pyrus by following the online manual
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-30336@lists.php.net to get a copy of this message
On Sun, Feb 28, 2010 at 10:11 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote: > >  (sort of a solution below): > > On Sun, 28 Feb 2010, Robert P. J. Day wrote: > >>   i'm sure this is easy to fix, but there's a bit of a disconnect >> between the way pyrus works and what the online doc says about it. >> >>   running fairly up-to-date fedora 12 system, with PHP 5.3.1: >> >> $ rpm -q php >> php-5.3.1-1.fc12.x86_64 >> $ >> >> so this system would seem to be pyrus-ready.  grab pyrus.phar from >> pear2.php.net, and try: >> >> $ php pyrus.phar >> PHP Fatal error:  Class 'XMLReader' not found in >> phar:///home/rpjday/Downloads/pyrus.phar/PEAR2_Pyrus-2.0.0a1/php/pear2/Pyrus/XMLParser.php >> on line 35 >> $ >> >>   the pyrus installation page >> (http://pear.php.net/manual/en/installationpyrus.introduction.php) >> claims: >> >> "Install PHP 5.3.1 or newer. Pyrus needs the phar, simplexml, libxml2, >> spl and pcre extensions in order to work. Fortunately, these are all >> enabled by default in PHP 5.3." >> >>   i'm going to suggest that be written a bit more carefully since a >> *lot* of linux versions have pre-packaged version of PHP, and it's not >> clear *how* they're packaged.  in any event, you can see what the doc >> page claims above, but if you look inside pyrus.phar, you read: >> >> foreach (array('phar', 'spl', 'pcre', 'simplexml') >> as $ext) { >>     if (!extension_loaded($ext)) { >>         echo 'Extension ', $ext, " is required\n"; >>         exit -1; >>     } >> } >> >> note the absence in the code for checking for libxml2, as the doc >> page suggests.  but what's the proper way to satisfy that dependency >> these days?  and should pyrus.phar explicitly check for that >> extension?  i'm trying to clarify this only because the online >> manual strongly suggests that installing pyrus is a piece of cake >> but, depending on your linux distro, you might have a bit of extra >> work to do and that should be documented. Pyrus should check for the extension. The file which needs the patch is here - http://svn.php.net/viewvc/pear2/Pyrus/trunk/stub.php?view=markup >  being fairly new to both PHP and PEAR, someone is welcome to correct > me if i misunderstand how extensions work.  for pyrus to work, one > *must* have the xmlreader extension/module installed.  if that's been > compiled into PHP itself, then great, you're good to go.  but on my > fedora 12 system, if i check with phpinfo, it was clearly *not* > configured in: > > ... '--disable-xmlreader' '--disable-xmlwriter' ... > >  now i could build php from scratch but i'd rather not do that -- i > prefer to keep my fedora system maintained via yum-installable > packages, or perhaps using pear or pecl.  as i read it, this requires > me to somehow install the xmlreader extension after the fact, correct? > the problem, though, is explained here: > http://www.phpbuilder.com/manual/en/ref.xmlreader.php > > "The XMLReader extension is available in PECL for PHP 5.0 and is > included in PHP 5.1 by default. It and can be enabled by adding the > argument --with--xmlreader  to your configure line. The libxml > extension is required." > > but if you have a prepackaged PHP without that extension, and you > don't want to reconfigure and rebuild, what's your option?  i don't > see either an approved pear or pecl extension to install to give me > that.  (the PECL xmlreader extension is listed as officially > deprecated and unsupported.) > >  turns out, after some searching, i chanced across the fedora package > "php-xml", which i yum-installed and which consists of the following > files: > > $ rpm -ql php-xml > /etc/php.d/dom.ini > /etc/php.d/wddx.ini > /etc/php.d/xmlreader.ini > /etc/php.d/xmlwriter.ini > /etc/php.d/xsl.ini > /usr/lib64/php/modules/dom.so > /usr/lib64/php/modules/wddx.so > /usr/lib64/php/modules/xmlreader.so > /usr/lib64/php/modules/xmlwriter.so > /usr/lib64/php/modules/xsl.so > $ > > which is clearly what i was after.  but there was nothing to tell me > that, i just *guessed* that there was a fedora package out there and > went looking for it.  what are others supposed to do if they need > "xmlreader" capability but don't know where to find it? I think the check for the extension could solve a lot of the confusion... and perhaps an improved error message: "Pyrus requires extension 'X.' You need to compile PHP with 'X' support or install an additional package from your o/s provider." Within the manual, we may be able to provide some assistance for major distros, but I really think this is a fedora issue because they are distributing a non-standard binary of PHP. Extensions enabled by default should be compiled in or auto-installed. I think we need to patch the manual and the stub.php file, and also complain to your distro that PHP extensions which should be enabled by default are not installed. -- Brett Bieber

« previous php.pear.general (#30336) next »