[英]libvirt-php receives the error: unable to connect to server Permission denied
[英]libvirt-php receives the error: internal error Unable to locate libvirtd daemon in /usr/sbin
我已经安装了php-libvirt以及我设置我的php文件所需的所有包,如下所示:
<?php
echo “WebAdmin 0.1Beta”;
echo “<br/>”;
$uri=”qemu:///system”;
echo (“Connecting to libvirt (URI:$uri)\n”.”<br/>”.”<br/>”);
$conn=libvirt_connect($uri,false);
if ($conn==false)
{
echo (“Libvirt last error: “.libvirt_get_last_error().”\n”);
exit;
}
但是,当我加载页面时,我得到:
WebAdmin 0.1Beta
Connecting to libvirt (URI:qemu:///system)
Libvirt last error: internal error Unable to locate libvirtd daemon in /usr/sbin (to override, set $LIBVIRTD_PATH to the name of the libvirtd binary)
我运行时从命令行运行良好
[root@localhost ~]# virsh -c qemu:///system list
Id Name State
----------------------------------------------------
我检查了Libvirtd状态,它也在运行
[root@localhost ~]# service libvirtd status
libvirtd (pid 14017) is running...
可能是什么问题?
你在/usr/sbin
有libvirtd
可执行文件吗?
您应该找到它的位置并将$LIBVIRTD_PATH
指向正确的文件夹。
如果您以非root用户身份运行脚本,那么可执行文件可能就在那里,只是脚本没有使用它的权限。
ps可能这个问题是针对Server Fault的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.