You can use command line arguments, but you need to use the $argv array. And the $argv array is only available if the register_argc_argv setting is enabled in PHP.
This is disabled by default, but you can create a php.ini file to enable register_argc_argv.
To enable this setting:
- Download your existing php.ini or create a new one in your text file
- Add the following line:
register_argc_argv = On
- Upload the file
You can then specify this particular php.ini file in the command for the scheduled task. For example, if you use:
/usr/bin/php5 –c /home/sites/your-domain.com/php.ini /home/sites/your-domain.com/cron.php argument1 argument2
The cron.php file will be able to use argument1 and argument2 when running.




