PHP Functionality
Hello,
I'm sure I'm doing something rather silly but I cannot work out what is going on. I have recently downloaded and installed Fedora 14 on my server. I am trying to write some PHP. I cannot however, get some of its functionality to work. Here's an example: SimpleXmlElement. I read that it is part of the core PHP package and thus no 'import'/'include'/etc. is needed. However, on my server, using Firefox 3.6.12, the webpage just crashes on the line Code:
$x = new SimpleXmlElement($content); Running it in the command prompt I get, what looks like, the correct output, but with these added warnings, which I don't understand: Code:
PHP Warning: SimpleXMLElement::__construct(): Entity: line 8: parser error : Entity 'raquo' not defined in includes/functions.php on line 7 http://net.tutsplus.com/demos/08_RSS...eeds/index.php I know it works as I've tried it on another server successfully. My first thought was that that it maybe some configurations in httpd.conf, but I am not sure. I'm rather confused! Any help would be greatly appreciated. Thanks in advance, The Godfather |
Quote:
What version does it have your computer? Made a simple test.php page with this content: <?php phpinfo();?> And compare the output between that server where it works and your computer. Regards |
Hi fcintron,
Quote:
Quote:
|
Why not try something simpler, like the suggested phpinfo() call, or even
Code:
<?php |
Hi Ryan,
Thanks for your help. Quote:
Code:
php index.php |
Hi
Can you post the XML file you are trying to parse? From the error message it looks like it's not proper XML. This is incorrect: Code:
<xml> Code:
<xml> I also got XML parse errors upgrading PHP to the newer versions. It seems the older versions allowed many weird XML files, whereas the newer versions are more strict. For example, some XML files coming from some .NET application had the prefix <?xml version="1.0" encoding="unicode"?>. It was actually UTF-16LE and older versions of PHP would parse it, but not the newer ones. After changing the prefix to <?xml version="1.0" encoding="UTF-16"?> they parsed fine. |
All times are GMT -5. The time now is 06:55 PM. |