cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems with Curl & Apache

From: Guenter Knauf <eflash_at_gmx.net>
Date: Wed, 18 Aug 2004 03:57:05 +0200

Hi Eric,
> I just moved from IIS to Apache and am having problems getting Curl to
> work
> properly on it using virtual domains under SSL. I am running Apache
> 2.0.50
> with Curl libcurl/7.10.8 OpenSSL/0.9.7d (according to phpinfo() ).

> My problem is that I seem to need to specify my .pem file with an absolute
> pathname. I used to be able to specify relative pathnames in IIS.

> If I try the following:
> $ch = curl_init ();
> $key = key.pem
> curl_setopt ($ch, CURLOPT_SSLCERT, $key);
> ...
> $result = curl_exec ($ch);

> If I specify $key as being a relative path (ie: $key = keyfile.pem) then I
> get the following in my Apache log:
> * unable to set certificate file (wrong password?)

> However, if I specify $key as being an absolute path (ie: $key =
> c:\data\keyfile.pem) then it works fine.

> Am I missing a configuration line in my apache configuration file? I have
I dont think so. If that worked before with same php and libcurl version, and you only moved from the IIS PHP connector to the Apache module (hopefully Apache2), and now it doesnt work then that is simply a question of the PHP connector;

> Anyone have an idea? If I am posting in the wrong group, can you please
> direct me to the right place?
if you really consider this as bug then I would create a php bug, and see what you get back...

otherwise there are a couple of possible workarounds for that;
look at the phpinfo() page for server-provided vars which contain the absolute path of the calling script, if you strip the script name from that you have the absolute path.

Guenter.
Received on 2004-08-18