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

curl-and-php

Re: Root directory for uploading files

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 17 Mar 2011 13:19:42 +0100 (CET)

On Wed, 16 Mar 2011, Rikki Prince wrote:

> A bit of debugging later, I found that rather than relative to the directory
> the PHP script is in, or even the document root, libcurl was looking for the
> file in the server root (C:\apache in my case). Of course, I was being
> stupid, it tells me to use the full path here:
> http://php.net/manual/en/function.curl-setopt.php
>
> However, I was wondering if there is a reason for this inconsistency between
> libcurl on Mac and Windows? Have I just messed up my server config or is
> this a known bug?

The inconsistency is not caused by libcurl. libcurl uses the exact file you
ask it to, be it relative or absolute. The inconsistency is rather in Apache
or PHP that seemingly don't have the same current directory behaviors when PHP
programs run.

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2011-03-17