SimpleXMLElement not working in XAMPP 1.7.1

Problems with the Windows version of XAMPP, questions, comments, and anything related.

SimpleXMLElement not working in XAMPP 1.7.1

Postby paulmasri » 06. April 2011 16:05

When I call
Code: Select all
SimpleXMLElement("...an XML string...")
I get the error
Fatal error: Call to undefined function simplexmlelement()
Can you help?

I have XAMPP 1.7.1 installed (because I need PHP 5.2).
NB: I've checked to see that libxml is installed. When I run
Code: Select all
print_r(get_loaded_extensions());
it lists libxml and SimpleXML.

Any ideas? :?:
paulmasri
 
Posts: 3
Joined: 06. April 2011 15:50

Re: SimpleXMLElement not working in XAMPP 1.7.1

Postby WilliL » 06. April 2011 17:23

found for you with goole search 8)
"Fatal error: Call to undefined function simplexmlelement()"

http://www.webdeveloper.com/forum/showthread.php?t=191658
Willi
WilliL
 
Posts: 628
Joined: 08. January 2010 10:54
XAMPP Version: 5.5.19
Operating System: Win7Home Prem 64 SP1

Re: SimpleXMLElement not working in XAMPP 1.7.1

Postby paulmasri » 07. April 2011 11:21

WilliL wrote:found for you with goole search 8)
"Fatal error: Call to undefined function simplexmlelement()"

http://www.webdeveloper.com/forum/showthread.php?t=191658


Unfortunately there isn't an simplexml extension to uncomment in the XAMPP php.ini.
For what it's worth, I put "extension=simplexml.dll" anyway (changing the .so from the above URL to a .dll as we're on Windows). Apache restarted OK (to my surprise) but it didn't solve the problem. Looking through the xampp\php\ext folder shows that simplexml.dll isn't there.

NB: I did a fair bit of Google searching before posting here... not to say I didn't miss something tho!

Anyone else got ideas about getting SimpleXMLElement() working in XAMPP 1.7.1?
paulmasri
 
Posts: 3
Joined: 06. April 2011 15:50

Re: SimpleXMLElement not working in XAMPP 1.7.1

Postby paulmasri » 20. April 2011 14:15

After a bit more checking, I see that SimpleXML is enabled, by looking at phpinfo(). Any ideas why it still says "undefined function simplexmlelement()"?
paulmasri
 
Posts: 3
Joined: 06. April 2011 15:50

Re: SimpleXMLElement not working in XAMPP 1.7.1

Postby drull » 11. May 2013 19:24

Because SimpleXMLElement is not a function, it's a class.
Use it like this:
$xml = new SimpleXMLElement(....)
drull
 
Posts: 1
Joined: 11. May 2013 19:22
XAMPP Version: 5.6.3
Operating System: Debian / Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 46 guests