Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Uncaught Exception: String could not be parsed as XML in /root/git/box-sfr-munin/script.php:137 #1

Open
birse29 opened this issue Feb 20, 2022 · 1 comment

Comments

@birse29
Copy link

birse29 commented Feb 20, 2022

Hello,

Thx for the share of this code. I try to use it without munin first by setting manually ip & password

function graph($graph) {
$ip = "myip";
$password = "mypassword";

But when I run the script.php I am facing this issue:

PHP Fatal error: Uncaught Exception: String could not be parsed as XML in /data/box-sfr-munin/script.php:159
Stack trace:
#0 /data/box-sfr-munin/script.php(159): SimpleXMLElement->__construct()
#1 /data/box-sfr-munin/script.php(279): graph()
#2 {main}
thrown in /data/box-sfr-munin/script.php on line 159

Can you help me please ?

Teddy

@msklywenn
Copy link
Owner

msklywenn commented Feb 21, 2022

You should print curl's output to check what the box is sending you.
Turn $ret = new SimpleXMLElement(curl_exec($ch)); into something like

$ret = curl_exec($ch);
echo $ret;
$ret = new $ret = SimpleXMLElement($ret);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants