Dman8568 Posted January 22, 2006 Posted January 22, 2006 I have a PHP script I need to run through Cron. I've tried several different things, but I always get an error message sent to my cron E-Mail address I know for PEARL you need to put the path to PEARL at the top of the file. Do you need to do something like that in PHP? Many Thanks, Dman8568 Quote
TCH-Rob Posted January 22, 2006 Posted January 22, 2006 I believe you need something like >/usr/bin/php Quote
Dman8568 Posted January 22, 2006 Author Posted January 22, 2006 Ok, I've tried that, and it didn't work. Here is the top of the script I need to run through cron: >#!/usr/bin/php <?php ... ... ?> Here is the Error Message I'm getting in my Cron Inbox: /bin/sh: /home/wvtroop/system/cron/clean_db.php: /usr/bin/php: bad interpreter: No such file or directory Any Ideas? Many Thanks, Dman8568 Quote
TCH-Bruce Posted January 22, 2006 Posted January 22, 2006 Set your cron job up using something like this: >/usr/bin/php -q /home/yourCPANELname/public_html/path-to-script Quote
Dman8568 Posted January 22, 2006 Author Posted January 22, 2006 (edited) So I would put into the cron panel of CPanel >/usr/bin/php -q /home/wvtroop/system/cron/sessions_clean.php In order to run the program at "/home/wvtroop/system/cron/sessions_clean.php" Is this right? Edited January 22, 2006 by Dman8568 Quote
TCH-Bruce Posted January 22, 2006 Posted January 22, 2006 That would not be correct unless "system" is a folder at the same level as your "public_html" folder and sessions_clean.php was inside of it. Quote
Dman8568 Posted January 22, 2006 Author Posted January 22, 2006 Yes I have a folder below the Public_html folder called "system" I have my dir tree set up like this: >/wvtroop/ public_html/ system/ cron/ db/ includes/ sub-routines/ Quote
TCH-Bruce Posted January 22, 2006 Posted January 22, 2006 >/usr/bin/php -q /home/wvtroop/public_html/system/cron/sessions_clean.php Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.