I am using libvirt-php to manage my virtual machines, and I need to shutdown/destroy domU.
For this I used the following php script:
< ? php $conn=libvirt_connect("xen:///");
$name=libvirt_domain_lookup_by_id($conn,4);
$dest=libvirt_domain_destroy($name);
echo $dest; ?>
When I run this on xampp server i get the following output:
Warning: libvirt_domain_destroy() [function.libvirt-domain-destroy]: operation virDomainDestroy forbidden for read only access in /opt/lampp/htdocs/xampp/byname.php on line 5.
Here is the documentation: http://libvirt.org/php/api-reference.html#libvirt_domain_destroy
whoami; in Terminal, output: root. This verifies that I am logged in as root user. But when I execute this php-script < ?php echowhoami; ?> output: nobody. So did u know how to login as root in apache web server? Or how to make user and assign admin/root privileges? – Alee Mar 26 '12 at 14:03