Search code examples
phpcronmamp

PHP Cron job on MAMP / OSX


I've tried following the instructions here but I still can't get my cron job working on my mac using crontab.

I've saved the following cron job:

*/2 *   *   *   *   /usr/bin/php http://localhost/social-api-examples/cron.php

And when I type crontab -l it shows me it's saved. But my PHP page isn't being hit. Is there a way to check if it's working?

Also, when I saved the cron job, it was to a temporary file location. Is that ok?


Solution

  • The solution was just to use "php" instead of the path to php:

    */2 *   *   *   *   php http://localhost/social-api-examples/cron.php