ID: 38233
User updated by: khalid at pixelcraze dot com
Reported By: khalid at pixelcraze dot com
-Status: Feedback
+Status: Open
Bug Type: SOAP related
Operating System: FC 4
PHP Version: 5.1.4
New Comment:
Script requires Pear://Services_Google and a google API Key from
www.google.com/api/
<?php
require_once("Services/Google.php");
$key = "Google_Key";
for($i=1;$i<200;$i++) {
$google = new Services_Google($key);
$google->queryOptions['limit'] = 1000;
$google->search('"page '.$i.'"');
$googleRes = $google->numResults();
echo "$i: $googleRes\n";
}
?>
THe issue is that sometimes this script will run fine. Another time,
the script will die at random intervals...
Previous Comments:
------------------------------------------------------------------------
[2006-07-28 10:28:11] [EMAIL PROTECTED]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2006-07-27 11:19:45] khalid at pixelcraze dot com
Same error occurs on the latest:
PHP 5.2.0RC2-dev (cli) (built: Jul 27 2006 12:05:06)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
------------------------------------------------------------------------
[2006-07-27 10:31:16] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-07-27 10:22:11] khalid at pixelcraze dot com
Description:
------------
Randomly, the script will produce a fatal error. I am not sure if this
is to do with the Services_Google, or whether it is a PHP Soap issue...
Reproduce code:
---------------
$google = new Services_Google($key);
$google->queryOptions['limit'] = 1000;
$google->search('"'.$keyword.'"');
$googleRes = $google->numResults();
Expected result:
----------------
I expect the results to appear. However, randomly, a fatal error is
thrown. Most of the time, it will work. It is only when processing a
few hundred queries at a time...
Actual result:
--------------
PHP Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching
http headers in /usr/local/lib/php/Services/Google.php:203
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...',
'http://api.goog...', 'urn:GoogleSearc...', 1, 0)
#1 [internal function]: SoapClient->__call('doGoogleSearch', Array)
#2 /usr/local/lib/php/Services/Google.php(203):
SoapClient->doGoogleSearch('key...', '"sapphire3d.co....', 0, 10, true,
'', true, '', '', '')
#3 /usr/local/lib/php/Services/Google.php(155):
Services_Google->runQuery()
#4 /path/file.php(77): Services_Google->numResults()
#5 {main}
thrown in /usr/local/lib/php/Services/Google.php on line 203
Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http
headers in /usr/local/lib/php/Services/Google.php:203
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...',
'http://api.goog...', 'urn:GoogleSearc...', 1, 0)
#1 [internal function]: SoapClient->__call('doGoogleSearch', Array)
#2 /usr/local/lib/php/Services/Google.php(203):
SoapClient->doGoogleSearch('key...', '"sapphire3d.co....', 0, 10, true,
'', true, '', '', '')
#3 /usr/local/lib/php/Services/Google.php(155):
Services_Google->runQuery()
#4 /path/file.php(77): Services_Google->numResults()
#5 {main}
thrown in /usr/local/lib/php/Services/Google.php on line 203
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38233&edit=1