Headache with bash and php
===

I need to execute the following code using php.
>virt-install --hvm --name ubuntuserver --ram 1024 --disk path=/root/Downloads/windows8.img,size=15  --cdrom /root/Downloads/ubuntu-12.04-server-i386.iso

To do this I created a bash file that includes:
    > '#'! /bin/bash 

>virt-install --hvm --name ubuntuserver --ram 1024 --disk path=/root/Downloads/windows8.img,size=15  --cdrom /root/Downloads/ubuntu-12.04-server-i386.iso

and save it with .sh extension and give permissions to this file: 
    >chmod -R 777 /opt/lampp/htdocs/xampp/myvms/ubuntuserver.sh

When I am going to the directory /opt/lampp/htdocs/xampp/myvms and double click it and select "Run in terminal" it will execute successfully.
Now I want to execute it using php. I have searched alot. I have tried:

>exec('bash /opt/lampp/htdocs/xampp/myvms/windows8.sh'); 

   
     $result=shell_exec("/opt/lampp/htdocs/xampp/myvms/windows8.sh");echo($result);

>system("source /opt/lampp/htdocs/xampp/myvms/windows8.sh ");

     shell_exec('sh /opt/lampp/htdocs/xampp/myvms/windows8.sh'); also

>$contents = file_get_contents('/opt/lampp/htdocs/xampp/myvms/windows8.sh');
echo shell_exec($contents);

Even not a single function get the job done :(

I have 3 questions: 
**(i)** Can we execute a bash file using php? **(ii)** How to execute the above bash file? and **(iii)** Can I directly run my desired command directly? Like consider:
>$command="virt-install --hvm --name ubuntuserver --ram 1024 --disk path=/root/Downloads/windows8.img,size=15  --cdrom /root/Downloads/ubuntu-12.04-server-i386.iso";

Now can I execute $command directly??



