#19301 [NEW]: curl_exec crashes
| From: | honza at honza dot info | Date: | Mon, 09 Sep 2002 06:39:38 +0000 |
| Subject: | #19301 [NEW]: curl_exec crashes | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-18722@lists.php.net to get a copy of this message | ||
From: honza@honza.info
Operating system: Windows XP Professional CZ
PHP version: 4.2.3
PHP Bug Type: Reproducible crash
Bug description: curl_exec crashes
Hello,
I'm a newbie to PHP, so it may be something wrong on my side. But I
checked the problem, reproduced it many times so here I send it.
I replicated the problem many times in Windows XP Professional CZ, which I
use as my operating system. I also have a separate instalation of Windows
2000 Professional CZ SP2, which I use for my full time job, and I
replicated the problem there as well. While there is a lot of software
installed on my WinXP system, the Win2000 system was completely clean (I
was reinstalling the system for new project), so there was just Win2000
Pro CZ SP2 and PHP 4.2.3 on the system, nothing more. The only difference
was the crash dialog it produced: under Win2k it was the dialog "Error in
program: php.exe generated errors and so Windows closed it. It is
neccessary to restart the program. Generating error protocol. OK button",
while WinXP give the dialog of "Error occured in php.exe application and
it is necessary to close it. We are apologizing for caused problems. ...
Report the problem to Microsoft ... Send the report button and Don't send
button" (please note that I use the Czech localization of Windows and here
I translated back the messages from the dialogs in Czech language in my
Windows into English, so the original texts may differ).
What I did: I copied the example featured at curl_init function
documentation to a file, and changed the url, so it is now:
<?php
$ch = curl_init ("http://www.ebay.com");
$fp = fopen ("output/result.txt", "w");
curl_setopt ($ch, CURLOPT_FILE, $fp);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_exec ($ch);
curl_close ($ch);
fclose ($fp);
?>
This simple code crashes with dialogs mentioned above. It always crashes,
I had no successfull run.
Note 1: Commenting the lines (using //) in the source I came to the result
that the crashing function is curl_exec(). Other functions work OK. If I
comment only the line with curl_exec() and nothing more, the script will
successfully run.
Note 2: I uncommented the php_curl.dll in php.ini, the extension is
allowed (I tried the script with the extension left commented, and then it
fails on line with curl_init() function).
Note 3: The extension_dir in php.ini is set to proper location. I tried it
set to wrong dir and it produced errors on curl_init() function.
Note 4: It crashes no matter if it is run from DOS-prompt using php.exe,
php-cli.exe or via web server (IIS).
Note 5: When run through IIS the "output" directory has the write allowed,
and the file "result.txt" is created. As curl_exec fails, the file
"result.txt" is left of 0 lenght.
Note 6: Although I didn't see it mentioned in the install documentation
for Windows, before getting into this crashing problem I got a report that
"libeay32.dll cannot be loaded". Of course adding php-install-dir/dlls
into PATH env variable helped. I think it would be good to add this into
install documentation.
OK, that's all for now. Tomorrow I'll try it on different machines
(although they will all be Windows, but simply up-to-date I tried it only
on one computer, just different systems) and I'll report if it behaves the
same in there as well.
Thanx. Honza
--
Edit bug report at http://bugs.php.net/?id=19301&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19301&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19301&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19301&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19301&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19301&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19301&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19301&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19301&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19301&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19301&r=globals