I try the put in the example and try run, but it's don't seem to be works.
Do you have the same problem, do you know how should i proceed ?
root@cn1:/var/www# cat info.php
<?php
print_r ( libvirt_version() );
$conn = libvirt_connect('null', false);
// $conn = libvirt_connect('qemu+ssh://root@10.0.0.122/system', false);
echo $conn;
$doms = libvirt_list_domains($conn);
print_r($doms);
?>
root@cn1:/var/www#
It doesn't show any output..
I also put this example into a file log.php and run it.
<?php
$logfile = 'test.log';
unlink($logfile);
if (!libvirt_logfile_set($logfile))
die('Cannot set the log file');
$conn = libvirt_connect('null', false);
unset($conn);
$fp = fopen($logfile, 'r');
$str = fread($fp, filesize($logfile));
fclose($fp);
echo $str;
?>
It does generate a file and show error..
[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
[2011-10-26 23:17:07 libvirt-php/core]: libvirt_connect: Cannot establish connection to (null)
My /var/www directory is like below:-
root@cloudnode1:/var/www# ls -laR
.:
total 36
drwxr-xr-x 4 www-data www-data 4096 2011-10-26 23:20 .
drwxr-xr-x 15 root root 4096 2011-10-26 22:40 ..
-rw-r--r-- 1 www-data www-data 177 2011-10-26 22:40 index.html
-rw-r--r-- 1 www-data www-data 229 2011-10-26 23:16 info.php
drwxr-xr-x 2 root root 4096 2011-10-26 23:15 .libvirt
-rw-r--r-- 1 www-data www-data 313 2011-10-26 22:59 log.php
drwx------ 2 www-data www-data 4096 2011-10-26 23:12 .ssh
-rw-r--r-- 1 www-data www-data 4619 2011-10-26 23:17 test.log
./.libvirt:
total 8
drwxr-xr-x 2 root root 4096 2011-10-26 23:15 .
drwxr-xr-x 4 www-data www-data 4096 2011-10-26 23:20 ..
lrwxrwxrwx 1 www-data www-data 29 2011-10-26 23:02 .libvirt-sock -> /var/run/libvirt/libvirt-sock
./.ssh:
total 16
drwx------ 2 www-data www-data 4096 2011-10-26 23:12 .
drwxr-xr-x 4 www-data www-data 4096 2011-10-26 23:20 ..
-rw------- 1 www-data www-data 1675 2011-10-26 23:11 id_rsa
-rw-r--r-- 1 www-data www-data 401 2011-10-26 23:11 id_rsa.pub
root@cloudnode1:/var/www#
Regards,
Peter
On Wed, Oct 26, 2011 at 10:09 PM, vmnode guy <vmnodeguy@xxxxxxxxx> wrote:
Thanks HetZ, it works now!Regards,PeterOn Tue, Oct 25, 2011 at 8:04 PM, חץ בן חמו <hetz@xxxxxxxxxxx> wrote:
Hi,Depending on which linux distribution you use, you'll need to install the php development packages.In Red Hat or Fedora it's php-devel while on ubuntu I think it's called php5-dev or something like that.Install and re-run ./configureGood luck,Hetz2011/10/25 vmnode guy <vmnodeguy@xxxxxxxxx>_______________________________________________Hi guys,I try to compile the libvirt-php but no luck, below are the output i got..webserver:~/libvirt-php-0.4.3 # ./configurechecking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... gawkchecking whether make sets $(MAKE)... yeschecking for style of include used by make... GNUchecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables...checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking dependency style of gcc... nonechecking for virConnectOpen in -lvirt... yeschecking dependency style of gcc... (cached) nonechecking whether to disable maintainer-specific portions of Makefiles... yeschecking for gcc... (cached) gccchecking whether we are using the GNU C compiler... (cached) yeschecking whether gcc accepts -g... (cached) yeschecking for gcc option to accept ISO C89... (cached) none neededchecking dependency style of gcc... (cached) nonechecking for a sed that does not truncate output... /usr/bin/sedchecking for gawk... (cached) gawkchecking for echo... echochecking for rm... rmchecking for pkg-config... /usr/bin/pkg-configchecking pkg-config is at least version 0.9.0... yeschecking for LIBXML... yeschecking for xsltproc... /usr/bin/xsltprocchecking for xmllint... /usr/bin/xmllintchecking for xmlcatalog... /usr/bin/xmlcatalogchecking for php-config... noconfigure: error: php-config not found; please install the PHP SDKwebserver:~/libvirt-php-0.4.3 # ls /etc/php5/apache2/ cli/ conf.d/webserver:~/libvirt-php-0.4.3 # ls /etc/php5/apache2/php.iniwebserver:~/libvirt-php-0.4.3 #Regards,Peter
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users
--חץ בן חמו
חץ-ביז (הוסטינג)
השכרה ואירוח של שרתים פיזיים
השכרת שרתים וירטואליים מקצועיים וגדולים במחירים קטנים
בקרו באתרנו בכתובת hetz.biz ובבלוג שלנו: blog.hetz.biz
טלפוןן: 0783333113/4/5, אימייל: sales@xxxxxxxx
מסנג'ר: sales@xxxxxxxx - סקייפ: heunique