XAMPP - MAC OS X - CRON JOB

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

XAMPP - MAC OS X - CRON JOB

Postby furi0usbee » 09. March 2017 13:58

Hi Folks! - I just discovered XAMPP and I really like having the ability to locally test PHP apps and such. It's really been great. The only thing I can't figure out is how to setup a CRON job locally.

First, below is the cron job I have running on my server with GoDaddy:

/usr/local/bin/php -q /home/account_name/public_html/cron.php (works on godaddy)

My first question is what is the actual path to PHP (to put into my cron command) on my Mac using XAMPP? I did the standard install, so locally, this is the path to php:

/Volumes/Macintosh HD/Applications/XAMPP/xamppfiles/bin/php

And the file I want to run is:

/Volumes/Macintosh HD/Applications/XAMPP/xamppfiles/htdocs/cron.php

Now, I can access that cron.php file directly from: http://localhost/cron.php, but that's probably not what I put in the cron command.

I have downloaded Cronnix for Mac to run cron jobs, and I'm trying to figure out the actual command. I will then run it every minute to test.

If you can offer any help, or if you are currently running cron on Mac using XAMPP, any info would be greatly appreciated.

GODADDY: /usr/local/bin/php -q /home/account_name/public_html/cron.php (works)
XAMPP with CRONNIX: ????????

Thanks,
Bryan
furi0usbee
 
Posts: 1
Joined: 09. March 2017 13:48
XAMPP version: 7.1.1-0
Operating System: OS X

Re: XAMPP - MAC OS X - CRON JOB

Postby Nobbie » 10. March 2017 12:32

furi0usbee wrote:/Volumes/Macintosh HD/Applications/XAMPP/xamppfiles/bin/php

And the file I want to run is:

/Volumes/Macintosh HD/Applications/XAMPP/xamppfiles/htdocs/cron.php



Finally results in: "/Volumes/Macintosh HD/Applications/XAMPP/xamppfiles/bin/php" -q "/Volumes/Macintosh HD/Applications/XAMPP/xamppfiles/htdocs/cron.php"
for your cronjob - whatelse?!

The ugly spaces in your pathnames are responsible for the need of quotes. If you replace "Macintosh HD" by "Macintosh_HD" for example, you can drop the quotes. Its never a good idea to have spaces in computer names and pathes.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 26 guests