Hi, I have a php file, which uses CURL to post data to some page. Now I want to run this php file from command line .ie., from cron job. Is it possible?
1) find where php executable is located 2) ensure you have access to it from cronjob (depends on your hoster) 3) run php script as something line this: /usr/bin/php yourscript.php
I know buddy hot to run the cron. But I'm not able to run the CURL used php page through cron. It give's the following error: Undefined function 'curl_init()'
There are 3 different versions of php. php as a apache module php-cli php-cgi. The one you want is php-cli (command line interface), which probably isn't compiled with curl support in your case. A way around is to use wget. * * * * * wget -bq -o /dev/null http://www.yoursite.com/script.php >/dev/null 2>&1