Reputation: 3225
I have a file called automate.php with a mysql connection string and a few PHP/SQL Queries and I want to run the file on a Cronjob.
I have tried just using the full URL like:
http://www.domain.com/script.php
the local path:
/home/your_username/public_html/script.php
and also:
php -f -q /home/your_username/public_html/script.php
i get an email every time it is run and its just saying: No input file specified.
what am i doing wrong?
Upvotes: 3
Views: 8191
Reputation: 1200
if wget does not work try
curl "http://url.com/script.php"
instead of
wget http://url.com/script.php
Upvotes: 0
Reputation: 191729
It sounds like a permissions issue. Make sure that the cron runner user has executable permissions on this php file. Also make the file executable:
chmod +x /path/to/script.php
At the top of the file add:
#! /usr/bin/env php
Now the script should be able to run on its own:
*/5 * * * * /path/to/script.php
Upvotes: 3
Reputation: 1
you should have your server domain + your script path i.e. http://server.domain.net/myscriptfolder/script.php which is http://server.domain.net absolut domain of your hosting/domain provider. In my case this works...
Upvotes: 0
Reputation: 3862
use this command
for every 5 minite
*/5 * * * * wget http://www.domain.com/script.php
Upvotes: 3