Re: PHP with cURL

From: Date: Tue, 15 Aug 2000 02:27:45 +0000
Subject: Re: PHP with cURL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-11722@lists.php.net to get a copy of this message
On 14 Aug, Claude Cormier wrote: > Hello everyone, > > I am running PHP4 on a FreeBDB 2.2.8 machine. This version of PHP what > not build --with-curl. > > I installed cURL in a custom account /u/myaccount as my hostmaster > doesn't let me install in user/local. > > Now I am running the following piece of code from a HTML page: > > > <?php > > exec("curl > http://www.ormetal.com/thanks.html",$results, $rc); > reset($results); > echo $results; > echo $rc; > > ?> > > Which doesn't work of course. $results contains "ARRAY" and $rc=127 > > My question: Even if I am not using the specific curl_..() functions > that access the curl libraries and instead calling directly the curl > standalone program, do I need to have PHP4 made --with-curl > > Thanks Claude Something is working as expected. Remember that exec returns an ARRAY which contains every line of output returned by the program you have run. You'd need to loop through each of the elements of $result to see what the output of the command was. Having said that, I'll make a small wager that there is an error :-) Unless curl is in a path known to the shell called by exec, then you will probably get a 'file not found' and you'll need to specify the absolute path to the command. Cheers -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#11722) next »