cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

cURL + PHP FastCGI problem

From: Lee Benson <ljb21183_at_hotmail.com>
Date: Fri, 13 Aug 2004 12:35:09 +0000

Hi guys:

I'm having a strange problem with cURL
using PHP.

I have three installations of PHP -- CLI,
Apache mod, and FastCGI, across 2 servers.

I have created a very simple script to
query a site, and return back information
on the transfer... here's the code...

=================================

$ch = curl_init('http://www.google.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1)');
curl_setopt($ch, CURLOPT_TIMEOUT, 60);

$curl_result = curl_exec($ch);
$curl_info = curl_getinfo($ch);
curl_close($ch);

print_r($curl_info);

=================================

When I launch this script using the CLI
installation of PHP (on the same server),
I get the following output...

Array
(
    [url] => http://www.google.com
    [content_type] => text/html
    [http_code] => 200
    [header_size] => 487
    [request_size] => 509
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 1
    [total_time] => 0.152
    [namelookup_time] => 0
    [connect_time] => 0.001
    [pretransfer_time] => 0.145
    [size_upload] => 0
    [size_download] => 1603
    [speed_download] => 10546.052631579
    [speed_upload] => 0
    [download_content_length] => 0
    [upload_content_length] => 0
    [starttransfer_time] => 0.151
    [redirect_time] => 0.017
)

However, when I run the same script through
Apache that routes to the FastCGI setup, I
get this...

Array
(
    [url] => http://www.google.com
    [http_code] => 0
    [header_size] => 0
    [request_size] => 0
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0
    [namelookup_time] => 0
    [connect_time] => 0
    [pretransfer_time] => 0
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => 0
    [upload_content_length] => 0
    [starttransfer_time] => 0
    [redirect_time] => 0
)

PHP doesn't return any errors, and cURL is
definitely installed along with the FastCGI
installation --

It just doesn't seem to even attempt to
connect to the URL.

Does anyone know of this problem, or how
to fix it so that FastCGI can work on the
FastCGI config?

Thanks! ~Lee

_________________________________________________________________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!
http://toolbar.msn.co.uk/
Received on 2004-08-13