cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Finally!!

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 17 Aug 2000 08:58:57 +0200 (MET DST)

On Wed, 16 Aug 2000, Claude Cormier wrote:

> Now I have PHP4 install system wide without cURL. Also have cURL custom.
> I can run cURL from PHP by executing curl. BUT... I can't use the new
> curl functions in PHP without makeing a custom install of PHP
> --with-curl.
>
> Is there a benefit to use the libs functions instead of executing curl
> that will convince me to do that custom PHP installation?

There are many, but all of them rather subtle.

1. Execution time. Running programs with a system() kind of function is a lot
slower than using the internal lib functions. However, for the typical small
server a few milliseconds difference won't be noticable.

2. Safety. Using system() kind of functions often "opens up" for mistakes
that makes the site vulnerable for the creative hacker to pass weird input to
the program and thus run selected programs in the shell that is invoked.

3. Memory usage. When you get a large amount of user at the same time, there
will be a substantial gain in memory usage when you go straight on the lib.

But these are all more or less clueful guesses, I am not familiar with the
PHP implementation, I'm just theorizing from a general point of view.

I'm sure the PHP people will have more input on this.

-- 
      Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Received on 2000-08-17