Link to home
Start Free TrialLog in
Avatar of ironpen45
ironpen45

asked on

SimpleXMLElement doesn't work under PHP Version 5.2.12

i'm trying to use SimpleXMLElement in a script but the result is always empty.

i found this documenting a version problem "SimpleXML doesnt Work with PHP 5.x: Problem & Solution" <http://blog.taragana.com/index.php/archive/simplexml-doesnt-work-with-php-5x-problem-solution/> but my issue is accessing the php.ini which my isp seem to be discouraging me from modifying it.

i also ran a test and got this "URL file-access is disabled in the server configuration" message confirming my problem.

does anyone know another way of getting around the compatibility issue using "SimpleXMLElement" and "file_get_contents"?

thanks!
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Please run this and post the output for us here.  It almost sounds like you are running in "safe mode" and that makes no sense at all.  Who is your hosting company?

FWIW, I have some sites at 5.2.12 and have no problems with SimpleXML.
<?php phpinfo(); ?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hernst42
hernst42
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ironpen45
ironpen45

ASKER

thanks everyone. my ISP just told me to create a PHP.INI on the directory where i'm running the php scripts with appropriate switches (eg., allow_url_fopen=ON) and that got solved the problem.
I am posting an objection to closing this without award of points.  Here is why:

Your original question stated "SimpleXMLElement doesn't work under PHP Version 5.2.12" and we demonstrated that that is not the issue. We asked you to post the phpinfo() but you did not do that.

I wrote "My guess is that the script you have is not getting any data because it is prohibited from reading files when the path is a URL."

hernst42 wrote "Ask your hoster to set allow_url_fopen to On."

So it seems that we told you EXACTLY what was wrong and what to do.

Please reconsider awarding points for this question, thanks.