Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install libvirt-php on my ubuntu server 11.10. Could any one tell me what are the simplest steps to install libvirt-php ??

share|improve this question
up vote 4 down vote accepted

Try the following:

sudo apt-get install libvirt-dev xsltproc libxml2-dev libxml2  
cd ~ 
git clone git:// libvirt-php  
cd libvirt-php  
sudo sh  
sudo ./configure  
sudo make  
sudo make install  
sudo service apache2 restart  

To verify it's installed run the following command

php -m | grep libvirt

You should see libvirt in the output.

share|improve this answer
Thank u so much. I have installed extensions. – Alee Jun 29 '12 at 7:45
Could you tell me how to create a new domain? From PHP API Reference guide: ( I have seen these functions: (i) libvirt_image_create($conn, $name, $size, $format) (ii) libvirt_domain_new($conn, $name, $arch, $memMB, $maxmemMB, $vcpus, $iso_image, $disks, $networks, $flags) (iii) libvirt_domain_create($res) (iv) libvirt_domain_create_xml($conn, $xml) The problem I am facing is that i dont know the steps to create a new domain. Either I have to create a new image first using libvirt_image_create .... or something else. – Alee Jun 29 '12 at 8:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.