Page 1 of 1

[solved] XAMPP 1.70 & PHP PDO: "document contains no data."

PostPosted: 24. February 2009 23:58
by appel
First off, kudos for a great webdevelopment package. Been gratefully using it on a daily basis for years! However, I'm experiencing a weird problem with version 1.7.0, quite possibly a bug, and I was hoping somebody can enlighten me with a solution. Here's the deal. I recently had to reinstall Windows XP (SP3) and thus also installed the latest version of XAMPP (1.7.0). Everything went fine, most of my local sites work, except for some of them that use PHP's PDO extension. Firefox says:

Code: Select all
Page Load Error
The document contains no data.
The network link was interrupted while negotiating a connection. Please try again.


After some debugging I found that this code was apparently causing the error:

Code: Select all
$dbh->query("SELECT * FROM blog")


So, I tried some example PDO code (3 lines), pulled from PHP.net, which gave the exact same result. I then tried my original code on a Linux live server (hosted), also with PHP 5.2.8 and it did work! Then I went on to download XAMPP 1.6.8 (with PHP 5.2.6). To my surprise (or perhaps not :) ) the original code worked like a charm, again.

So, in the good spirit of elimination, I'm inclined to believe there's a bug in the Windows version of PHP 5.2.8 / PDO that's bundled with XAMPP 1.7.0.

Can anybody confirm this? Any insights? Thanks!

Re: XAMPP 1.70 & PHP PDO: "The document contains no data."

PostPosted: 25. February 2009 04:23
by Izzy
Seems to be a bug issue.

These Google Results may help.

These Forum Search Results from several discussions and some fixes perhaps - open a result's topic to reveal more text and links.

This was one of the reported fixes with mixed results it seems, but some of the negative replies were perhaps related to issue other than the PDO bug.
viewtopic.php?p=131847#p131847

HTH

Re: XAMPP 1.70 & PHP PDO: "The document contains no data."

PostPosted: 25. February 2009 09:51
by bassclarinet
This seems to be a mistake in the XAMPP distribution.

Look in both the apache\bin and php folders for the file libmysql.dll (or libmysql_*.dll, don't remember the exact name).

libmysql.dll is dated 17-dec-2008 19:48 and has 1646592 bytes.
Replace it by the file libmysql_*.dll dated 04-aug-2008 with 2068480 bytes.

If you don't have this file, download the PHP 5.2.8 binaries from php.net and extract this libmysql.dll.
After replacing the file, restart the server. Done.

Re: XAMPP 1.70 & PHP PDO: "The document contains no data."

PostPosted: 25. February 2009 11:09
by appel
Thanks Izzy and bassclarinet for your kind responses and suggestions. I will look into it tonight (currently at work) and will post the results here.

Thanks again!

ap

edit: I followed bassclarinet's steps and sure enough it's working now so thank you both for your help! Just wondering, shouldn't XAMPP 1.7.0 be updated?