I am using core PHP and written a simple script that needs to be called automatically. For testing purpose I have just written a print statement as below,
$host = 'localhost';
$user = 'admin';
$pass = 'password';
$db = 'TestDB';
print ($user);
When I execute the script from the command line as below, it works fine
php /Applications/MAMP/htdocs/project/services/test.php > ~/cronOutput/test.txt
But when I call this from Cron, its not at all getting called. Below is the crontab command that I have,
* * * * * /usr/bin/php /Applications/MAMP/htdocs/project/services/test.php > ~/cronOutput/test.txt
* * * * * php /Applications/MAMP/htdocs/project/services/test.php > ~/cronOutput/test.txt
Both the commands above does not work.