#45419 [NEW]: curl_exec returns output when called from command line, FALSE from apache
From: circular at pctechnology dot gr
Operating system: Debian sarge
PHP version: 5.2.6
PHP Bug Type: cURL related
Bug description: curl_exec returns output when called from command line, FALSE from apache
Description:
------------
When the CURLOPT_RETURNTRANSFER option is set curl_exec returns the
correct output when called from the command line, but FALSE when called
through apache.
Configuration:
curl version: 7.18.2, apache 2.0.54
'./configure' '--prefix=/usr/local' '--with-apxs2=/usr/bin/apxs2'
'--with-config-file-path=/etc/php5/apache2' '--disable-debug'
'--with-regex=php' '--disable-rpath' '--disable-static'
'--with-pic'
'--with-layout=GNU' '--with-pear=/usr/share/php' '--enable-calendar'
--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg'
'--enable-bcmath'
'--with-bz2' '--enable-ctype' '--with-db4' '--with-iconv'
'--enable-exif'
'--enable-ftp' '--with-gettext' '--enable-mbstring'
'--with-pcre-regex=/usr/local' '--enable-shmop' '--enable-sockets'
'--enable-wddx' '--enable-xml' '--with-xmlrpc' '--with-zlib'
'--without-pgsql' '--with-kerberos=/usr' '--with-openssl=/usr'
'--enable-zip' '--with-mime-magic=/usr/share/misc/file/magic.mime'
'--with-exec-dir=/usr/lib/php5/libexec' '--without-mm' '--with-mysql'
'--without-sybase-ct' '--with-gd=/usr/local' '--with-jpeg-dir=/usr'
'--with-png-dir=/usr' '--with-xpm-dir=/usr'
'--with-freetype-dir=/usr/local' '--enable-gd-native-ttf'
'--with-curl=/usr/local'
Reproduce code:
---------------
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://some.url");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$converted = curl_exec($ch);
curl_close($ch);
var_dump($converted);
Expected result:
----------------
curl_exec returning the same output when the code runs either from the
console or apache.
Actual result:
--------------
the expected output when the code runs from the command line, FALSE when
run from within apache.
The error code returned is 28 (connection time-out), and curl_getinfo
returns a negative value for CURLINFO_NAMELOOKUP_TIME.
No errors are logged in apache or system logs.
--
Edit bug report at http://bugs.php.net/?id=45419&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45419&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45419&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45419&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45419&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45419&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45419&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45419&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45419&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45419&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45419&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45419&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45419&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45419&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45419&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45419&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45419&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45419&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45419&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45419&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45419&r=mysqlcfg
Thread (2 messages)
- circular at pctechnology dot gr