<br><br><div class="gmail_quote">On Wed, Oct 26, 2011 at 11:31 AM, vmnode guy <span dir="ltr"><<a href="mailto:vmnodeguy@gmail.com">vmnodeguy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">Hello HetZ,<div><br></div><div>I try the put in the example and try run, but it's don't seem to be works.</div>
<div><br></div><div>Do you have the same problem, do you know how should i proceed ?</div><div><br></div><div><div>root@cn1:/var/www# cat info.php </div><div><?php</div><div><br></div><div>     print_r ( libvirt_version() );</div>

<div><br></div><div>        $conn = libvirt_connect('null', false);</div><div>//      $conn = libvirt_connect('qemu+ssh://<a href="http://root@10.0.0.122/system" style="color:rgb(0, 0, 204)" target="_blank">root@10.0.0.122/system</a>', false);</div>

<div>        echo $conn;</div><div>        $doms = libvirt_list_domains($conn);</div><div>        print_r($doms);</div><div><br></div><div>?></div><div>root@cn1:/var/www# </div><div><br></div><div>It doesn't show any output..</div>

<div><br></div><div>I also put this example into a file log.php and run it.</div><div> </div><div><div><?php</div><div>    $logfile = 'test.log';</div><div><br></div><div>    unlink($logfile);</div><div>    if (!libvirt_logfile_set($logfile))</div>

<div>         die('Cannot set the log file');</div><div><br></div><div>    $conn = libvirt_connect('null', false);</div><div>    unset($conn);</div><div><br></div><div>    $fp = fopen($logfile, 'r');</div>

<div>    $str = fread($fp, filesize($logfile));</div><div>    fclose($fp);</div><div><br></div><div>    echo $str;</div><div>?></div></div><div><br></div><div>It does generate a file and show error.. </div><div><div>[Wed Oct 26 23:17:07 2011] [error] [client 10.0.0.201] PHP Warning:  libvirt_connect(): Failed to connect socket to '@/var/www/.libvirt/libvirt-sock': Connection refused in /var/www/log.php on line 8</div>

<div>[2011-10-26 23:17:07 libvirt-php/core]: libvirt_connect: Cannot establish connection to (null)</div></div><div><br></div><div><br></div><div>My /var/www directory is like below:-</div><div><div>root@cloudnode1:/var/www# ls -laR</div>

<div>.:</div><div>total 36</div><div>drwxr-xr-x  4 www-data www-data 4096 2011-10-26 23:20 .</div><div>drwxr-xr-x 15 root     root     4096 2011-10-26 22:40 ..</div><div>-rw-r--r--  1 www-data www-data  177 2011-10-26 22:40 index.html</div>

<div>-rw-r--r--  1 www-data www-data  229 2011-10-26 23:16 info.php</div><div>drwxr-xr-x  2 root     root     4096 2011-10-26 23:15 .libvirt</div><div>-rw-r--r--  1 www-data www-data  313 2011-10-26 22:59 log.php</div><div>

drwx------  2 www-data www-data 4096 2011-10-26 23:12 .ssh</div><div>-rw-r--r--  1 www-data www-data 4619 2011-10-26 23:17 test.log</div><div><br></div><div>./.libvirt:</div><div>total 8</div><div>drwxr-xr-x 2 root     root     4096 2011-10-26 23:15 .</div>

<div>drwxr-xr-x 4 www-data www-data 4096 2011-10-26 23:20 ..</div><div>lrwxrwxrwx 1 www-data www-data   29 2011-10-26 23:02 .libvirt-sock -> /var/run/libvirt/libvirt-sock</div><div><br></div><div>./.ssh:</div><div>total 16</div>

<div>drwx------ 2 www-data www-data 4096 2011-10-26 23:12 .</div><div>drwxr-xr-x 4 www-data www-data 4096 2011-10-26 23:20 ..</div><div>-rw------- 1 www-data www-data 1675 2011-10-26 23:11 id_rsa</div><div>-rw-r--r-- 1 www-data www-data  401 2011-10-26 23:11 id_rsa.pub</div>

<div>root@cloudnode1:/var/www# </div></div><div><br></div><div><br></div><div>Regards,</div><div>Peter</div></div></span></blockquote><div><br></div><div> Not sure what you're trying to do but I believe if you're trying to give null for connection, you should use null without quotes</div>
<div><br></div><div><div style="font-family: arial, sans-serif; font-size: 13px; "><div>[2011-10-26 23:17:07 libvirt-php/core]: libvirt_connect: Cannot establish connection to (null)</div><div><br></div><div>Could you try this possibly?</div>
<div><br></div><div>$conn = libvirt_connect(null, false);</div><div><br></div><div>PS, I have never used the PHP bindings but I just noticed that.</div></div></div></div><div><br></div>-- <br><span style="font-family:Arial;font-size:8pt"><span style="color:rgb(70, 130, 180);font-size:10pt">Mohammed Naser</span> — <span style="font-weight:bold">vexxhost</span><br>
</span><div><span style="font-family:Arial;font-size:8pt"><span><span style="color:rgb(220, 220, 220)">-----------------------------------------------------</span></span></span></div><div><span style="font-family:Arial;font-size:11px;font-weight:bold">D. </span><span style="font-family:Arial;font-size:11px">514-316-8872</span></div>
<div><span style="font-family:Arial;font-size:11px"><span style="font-weight:bold">D.</span> 800-910-1726 ext. 200</span></div><div><span style="font-family:Arial;font-size:11px"><span style="font-weight:bold">E. </span><a href="mailto:mnaser@vexxhost.com" target="_blank">mnaser@vexxhost.com</a></span></div>
<div><span style="font-family:Arial;font-size:11px"><span style="font-weight:bold">W. </span><a href="http://vexxhost.com/" target="_blank">http://vexxhost.com</a></span></div><br>