simplexml - Functions not Found

I've installed simplexml-1.0.1. Regarding the following scenario, any attempt to call a function from a PHP Version 5.4.20 script results in a fatal error:

# php test_simplexml.php
Code:
// test_simplexml.php

<?php
$xml = simplexml_load_string($xmlstring);
?>
Code:
Fatal error: Call to undefined function simplexml_load_string() in [FILE]test_simplexml.php[/FILE] on line 4
phpinfo() reveals the following:
Code:
XML Support     	active
XML Namespace Support 	active
libxml2 Version 	2.8.0
. . .but not SimpleXML support! (...which I do find in another installed PHP Version 5.2.17 on another server.)

I've already recompiled PHP, but I did not see a configuration option to specify simplexml support, re. the following:

# make config
Code:
┌─────────────────────────────── php5-5.4.20 ──────────────────────────────────┐

[x] CLI        Build CLI version 
[x] CGI        Build CGI version 
[ ] FPM        Build FPM version 
[x] APACHE     Build Apache module 
[x] AP2FILTER  Use Apache 2.x filter interface (experimental) 
[ ] EMBED      Build embedded library 
[ ] DEBUG      Enable debug 
[ ] DTRACE     Enable DTrace support 
[x] IPV6       Enable ipv6 support                                       
[ ] MAILHEAD   Enable mail header patch                                   
[x] LINKTHR    Link thread lib (for threaded extensions)                
[ ] ZTS        Force Zend Thread Safety (ZTS) build
Is there another configuration scenario that I'm overlooking?
 
Problem with Makefile(s)

Solution:

To Makefile in the CONFIGURE_ARGS= \ container, add:
Code:
                --enable-simplexml \

Makefile.ext already contains (and. . .not sure why the following doesn't accomplish the same):

Code:
.if ${PHP_MODNAME} == "simplexml"
CONFIGURE_ARGS+=--enable-simplexml \
                --with-libxml-dir=${LOCALBASE}
I don't know where the Makefile.ext is pickuped in the build process, but as noted regarding the addition to Makefile, after deinstall and reinstall ( # make build install clean), the support for simplexml is available as evidenced below from phpinfo():

Code:
Simplexml support => enabled
Revision => $Id: 2358f2be6570ab413d0ead3a931a5365adf94af9 $
Schema support => enabled
 
Extensions . . .hum, silly me. It's been several years since I compiled PHP Version 5.2.17, but if I were writing the Makefile for PHP v5.4.20 (current), I'd include a call to the php5-extensions Makefile (to make sure that people like me don't forget about it).



Hey, thanks for the heads-up :)
 
rtwingfield said:
Extensions . . .hum, silly me. It's been several years since I compiled PHP Version 5.2.17, but if I were writing the Makefile for PHP v5.4.20 (current), I'd include a call to the php5-extensions Makefile (to make sure that people like me don't forget about it).



Hey, thanks for the heads-up :)

Ahahah, I don't remember when and how I discovered this, initially also I was stuck with extensions. Some extensions are not listed in that port: devel/php-xdebug for example is not in the list and don't have 'php5-' prefix. Anyhow, for ports listed in lang/php5-extensions, when you install an extension without using this port, but listed in it, after installation you can check the options and you will see it checked, so you can install each single extension or recheck options and reinstall the lang/php5-extensions port, it's a meta-port, not really a port.

This meta-port maintain the extensions configuration files in /usr/local/etc/php/extensions.ini, it doesn't touch php.ini. If you want things go automatic, don't edit this file, add and remove extensions by meta-port. For xdebug I initially manually inserted it there after installation, but now I insert it in main php.ini (after the commented extensions list), also it's not a 'standard' extension, perhaps you insert it as zend extension.

I hope I was clear with my stray english.
 
Thanks yet again!

BTW, I once heard that the Russians have a "saying":
A person that speaks three languages is tri-lingual;
a person that speaks two languages is bi-lingual; and . . .
a person that speaks one language is [USA] American :p


Also, I've visited Italia twice (Tuscany) . . .beautiful country and great people! As we speak, I'm having a glass of Mezzacorona Pino Grigio, vigneti delle dolomiti IGI.
 
rtwingfield said:
Thanks yet again!

BTW, I once heard that the Russians have a "saying":


Also, I've visited Italia twice (Tuscany) . . .beautiful country and great people! As we speak, I'm having a glass of Mezzacorona Pino Grigio, vigneti delle dolomiti IGI.

;) cheers (cin cin) then
 
Back
Top