Hi Michal,<br><br>Here's the output. Please note that special characters were visible when opening the file with vi, though not with a cat on the console, so this is a copy/paste out of vi.<br><br>[2011-06-29 15:43:58 libvirt-php/core]: libvirt_connect: credentials index 2<br>

[2011-06-29 15:43:58 libvirt-php/core]: libvirt_connect: credentials index 5<br>[2011-06-29 15:43:58 libvirt-php/core]: libvirt_connect: Found 2 elements for credentials<br>[2011-06-29 15:43:58 libvirt-php/core]: libvirt_virConnectAuthCallback: cred 0, type 2, prompt Enter username for 10.9.0.2 [root] challenge 10.9.0.2<br>

 [2011-06-29 15:43:58 libvirt-php/core]: libvirt_virConnectAuthCallback: result rootV^? (4)<br>[2011-06-29 15:43:58 libvirt-php/core]: libvirt_virConnectAuthCallback: cred 0, type 5, prompt Enter rootV^?'s password for 10.9.0.2 challenge 10.9.0.2<br>

 [2011-06-29 15:43:58 libvirt-php/core]: libvirt_virConnectAuthCallback: result fakepass (12)<br>[Wed Jun 29 15:44:00 2011] [error] [client 10.9.1.10] PHP Warning:  libvirt_connect(): internal error HTTP response code 500 for call to 'Login'. Fault: ServerFaultCode - Cannot complete login due to an incorrect user name or password. in /var/www/virt.php on line 9, referer: <a href="http://10.9.0.3/">http://10.9.0.3/</a><br>

[2011-06-29 15:44:00 libvirt-php/core]: libvirt_connect: Cannot establish connection to esx://<a href="http://10.9.0.2?transport=http">10.9.0.2?transport=http</a><br><br>Best regards,<br>Koen Calliauw<br><br><br><br><div class="gmail_quote">

On Wed, Jun 29, 2011 at 3:35 PM, Michal Novotny <span dir="ltr"><<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi Koen,<br>
that's bad. I don't have logging of username and password length here.<br>
I'll try to work on this. You can try attached patch to extend logging<br>
by username and password in the mean time and provide me the full<br>
resulting log file? Please review whether there is no password and if<br>
there is then please change it to fakepass.<br>
<br>
Thanks,<br>
Michal<br>
<div class="im"><br>
On 06/29/2011 03:19 PM, Koen Calliauw wrote:<br>
> Hi Michal,<br>
><br>
> Here's what appears in the logfile when using libvirt_logfile_set:<br>
><br>
> [Wed Jun 29 15:18:00 2011] [error] [client 10.9.1.10] PHP Warning:<br>
> libvirt_connect(): internal error HTTP response code 500 for call to<br>
> 'Login'. Fault: ServerFaultCode - Cannot complete login due to an<br>
> incorrect user name or password. in /var/www/virt.php on line 9,<br>
> referer: <a href="http://10.9.0.3/" target="_blank">http://10.9.0.3/</a><br>
> [2011-06-29 15:18:00 libvirt-php/core]: libvirt_connect: Cannot<br>
> establish connection to esx://<a href="http://10.9.0.2?transport=http" target="_blank">10.9.0.2?transport=http</a><br>
</div><div class="im">> <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>><br>
><br>
</div><div class="im">> Best regards,<br>
> Koen Calliauw<br>
><br>
> On Wed, Jun 29, 2011 at 3:10 PM, Michal Novotny <<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a><br>
</div><div><div></div><div class="h5">> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>>> wrote:<br>
><br>
>     Hi Koen,<br>
>     thanks for you e-mail. I don't know what exactly is going on here but<br>
>     could you please try to enable debug logging using<br>
><br>
>     libvirt_logfile_set($filename, $maxsize)<br>
><br>
>     API function? The maxsize parameter is optional and it defaults to<br>
>     1024<br>
>     KiB (1M). The file have to have write permissions so you can touch the<br>
>     file, e.g. debug.log and change it's permissions to 777 to allow<br>
>     logging. Once you try to login using the script you mentioned with<br>
>     debug<br>
>     set you will get the debug output into the debug.log file which<br>
>     could be<br>
>     send to us for further analysis.<br>
><br>
>     Thanks,<br>
>     Michal<br>
><br>
><br>
>     On 06/29/2011 03:03 PM, Koen Calliauw wrote:<br>
>     > Hi all,<br>
>     ><br>
>     > I've started playing with libvirt-php yesterday and with the help of<br>
>     > Michal Novotny got it running quite painlessly. However, the login<br>
>     > from PHP to my testing ESXi server seems to be failing. I've<br>
>     > wiresharked the HTTP traffic with a virsh -c (which works) and<br>
>     > compared that to the traffic I see when using the libvirt-php<br>
>     > extension, here's the difference I see (mind the username)<br>
>     ><br>
>     > Not working (libvirt-php)<br>
>     ><br>
>     > <Login xmlns="urn:vim25"><_this xmlns="urn:vim25"<br>
>     > xsi:type="ManagedObjectReference"<br>
>     > type="SessionManager">ha-sessionmgr</_this><userName<br>
>     xmlns="urn:vim25"<br>
>     > xsi:type="xsd:string">root8.</userName><password xmlns="urn:vim25"<br>
>     > xsi:type="xsd:string">fakepass</password></Login><br>
>     ><br>
>     > Working (virsh -c)<br>
>     ><br>
>     > <Login xmlns="urn:vim25"><_this xmlns="urn:vim25"<br>
>     > xsi:type="ManagedObjectReference"<br>
>     > type="SessionManager">ha-sessionmgr</_this><userName<br>
>     xmlns="urn:vim25"<br>
>     > xsi:type="xsd:string">root</userName><password xmlns="urn:vim25"<br>
>     > xsi:type="xsd:string">fakepass</password></Login><br>
>     ><br>
>     > So for some reason something gets appended (8.) or encoded wrong or<br>
>     > something when I use the PHP extension. This is the testing code<br>
>     I run:<br>
>     ><br>
>     > <?php<br>
>     > $credentials =<br>
>     > array(VIR_CRED_AUTHNAME=>'root',VIR_CRED_PASSPHRASE=>'fakepass');<br>
>     > $conn = libvirt_connect("esx://<a href="http://10.9.0.2?transport=http" target="_blank">10.9.0.2?transport=http</a><br>
>     <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>><br>
>     > <<a href="http://10.9.0.2?transport=http" target="_blank">http://10.9.0.2?transport=http</a>>", FALSE, $credentials);<br>
>     > if($conn) {<br>
>     >     print_r(libvirt_connect_get_hypervisor($conn));<br>
>     ><br>
>     > } else {<br>
>     >     echo "Connection failed: ".libvirt_get_last_error();<br>
>     > }<br>
>     ><br>
>     > Any help with this issue would be greatly appreciated. Thanks!<br>
>     ><br>
>     > Best regards,<br>
>     > Koen Calliauw<br>
><br>
><br>
>     --<br>
</div></div>>     Michal Novotny <<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a> <mailto:<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>>>,<br>
<div class="im">>     RHCE, Red Hat<br>
>     Virtualization | libvirt-php bindings | <a href="http://php-virt-control.org" target="_blank">php-virt-control.org</a><br>
</div>>     <<a href="http://php-virt-control.org" target="_blank">http://php-virt-control.org</a>><br>
><br>
><br>
<font color="#888888"><br>
<br>
--<br>
</font><div><div></div><div class="h5">Michal Novotny <<a href="mailto:minovotn@redhat.com">minovotn@redhat.com</a>>, RHCE, Red Hat<br>
Virtualization | libvirt-php bindings | <a href="http://php-virt-control.org" target="_blank">php-virt-control.org</a><br>
<br>
</div></div></blockquote></div><br>