Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

EndingDesire

macrumors newbie
Original poster
Sep 22, 2010
5
0
I am trying to get a cron script to run on my server that I have set up through cpanel, and my current host is bluehost. Currently, I am using the following command:
Code:
/usr/bin/php /home1/username/public_html/domain/folder/file.php?time=morning&school=local
When it runs, I get an email saying that their was no input file. I have also tried this line of code
Code:
/usr/bin/php http://www.domain.com/folder/file.php?time=morning&school=local

Any idea on the issue here? Thank you!
 
I'm assuming you have the schedule portion on the cron line before the command, right?

One thing that comes to mind is to encode the HTML character &, so your command becomes,
Code:
/usr/bin/php /home1/username/public_html/domain/folder/file.php?time=morning&school=local
since & is used for commands. You could also try wrapping quotes around the file path.
 
I tried to add the & to my cron line and I still get the same email error message, with the addition of: /bin/sh amp: command not found.

I do not have the schedule before the command, the way bluehost has me set them up it's done via drop down boxes, so the two are sort of separate, I know there isnt an issue with the schedule, since I am getting the email failure notification.

Should I be using the direct link to the file, ie http://www.website/file.php or should i use a relative location of the file?

Also, is it possible /usr/bin/php is in a different location?
 
It could be in a different location. If you have shell access, e.g., SSH, then you can type in "which php" to find out where it is. Also check Bluehost's FAQ, which may tell you. The file path you're using is fine as long as it's pointed to the correct spot. I do mine the same way, but I don't have any PHP ones, I do mostly Perl.

Do you have a local setup that you can try the command on? Just wondering if maybe something in the script is causing the issue. I'd also contact Bluehost to see if they have any ideas. I've never used the web interface for doing cron, just the command line way.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.