Using curl on command line PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
flake
Forum Newbie
Posts: 1
Joined: Mon Mar 17, 2008 1:45 am

Using curl on command line PHP

Post by flake »

I have problem in using curl. The initialisation (curl_init()) runs fine and I can get the result from curl_exec() when I execute the script through web browser. But because I need to run the script as a cron, I need to run it on command line. And strangely I get an empty string when I execute curl_exec().

Any idea? Thank you.
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Using curl on command line PHP

Post by Zoxive »

Look at the difference between the php.ini files. It most likely isn't enabled for cli, but you should be getting some errors if you have error reporting on.

Code: Select all

/etc/php5/cli/php.ini
Post Reply