russellmcox Posted January 4, 2007 Posted January 4, 2007 I am using the following CRON Job Syntax: /usr/bin/php -f /hsphere/local/home/russellm/neighborhoodjobsearch.com/cron/cron.php > /dev/null and I'm getting the following error: /bin/sh: /usr/bin/php: No such file or directory Does anyone have any thoughts on why this is happening? Regards, Russell Cox Quote
TCH-Bruce Posted January 4, 2007 Posted January 4, 2007 Welcome to the forums Russell The syntax should be: >/usr/bin/php -q /home/your-id/public_html/cron/cron.php Quote
russellmcox Posted January 4, 2007 Author Posted January 4, 2007 Welcome to the forums Russell The syntax should be: >/usr/bin/php -q /home/your-id/public_html/cron/cron.php ------------------------- Thanks for your response Bruce. Since I have multiple domains, perhaps you can clarify for me... Where to I specify the domain name? Is it like so... /usr/bin/php -q /home/neighborhoodjobsearch.com/public_html/cron/cron.php ...or... /usr/bin/php -q /home/russellm/neighborhoodjobsearch.com/public_html/cron/cron.php ...or... /usr/bin/php -q /home/russellm/public_html/neighborhoodjobsearch.com/cron/cron.php The actual web address of the cron.php is as follows: http://www.neighborhoodjobsearch.com/cron/cron.php Regards, Russell Cox Quote
TCH-Andy Posted January 4, 2007 Posted January 4, 2007 Welcome to the forum, Russell /usr/bin/php -q /home/russellm/public_html/cron/cron.php Quote
TCH-Bruce Posted January 4, 2007 Posted January 4, 2007 I'm confused why you are entering your domain name in the command. Cron jobs (scripts) know nothing about your domain name they work strictly with paths. Say your neighborhoodjobsearch.com domain (I don't believe it's hosted here at TCH) is in an account called myaccount on a TCH server and the cron.php file was in the public_html/cron folder the command would look like this. >/usr/bin/php -q /home/myaccount/public_html/cron/cron.php You will notice "neighborhoodjobsearch.com" is nowhere listed in that command. But since the domain points to the public_html folder of myaccount that is how it would be entered. Quote
russellmcox Posted January 4, 2007 Author Posted January 4, 2007 I'm confused why you are entering your domain name in the command. Cron jobs (scripts) know nothing about your domain name they work strictly with paths. Say your neighborhoodjobsearch.com domain (I don't believe it's hosted here at TCH) is in an account called myaccount on a TCH server and the cron.php file was in the public_html/cron folder the command would look like this. >/usr/bin/php -q /home/myaccount/public_html/cron/cron.php You will notice "neighborhoodjobsearch.com" is nowhere listed in that command. But since the domain points to the public_html folder of myaccount that is how it would be entered. -------------------------------------- Maybe I should step back and start from square one... My Host is "CareFreeHosting" - Lance Prevost He used to call it Equine Hosting, prior to upgrading his server. He leases a server from you (so I'm told) and I host my domains with him. I have several domains on his (your) server. The principal ones are: www.neighborhoodclassified.com www.neighborhoodauction.com www.neighborhoodsoulmate.com www.neighborhoodjobsearch.com I requested his support to resolve why my CRON jobs are not running following a change in server platforms. He suggested I get in touch with you for this support. Now, please let me know if I'm in the right place to be asking these questions! If so... Each of my domains have their own respective CRON jobs, each located under a folder within the application files uploaded for the particular site in question. Thus it is necessary to distinguish where the particular CRON file to be executed is located. If necessary, I can provide ftp credentials for you to look for yourself to see these files... Please let me know. Regards, Russell Cox Quote
TCH-Bruce Posted January 4, 2007 Posted January 4, 2007 You will need to get the path info for your domains to create your cron jobs. Usually, the path will be this: /home/your-cPanel-name then depending on where in your account you put the cron script you would add the remainder of the path to it. So if you put it in a folder called cron inside the public_html folder the path would be /home/your-cPanel-name/public_html/cron/script-name Sorry, I can't be anymore help than that. Quote
click Posted January 4, 2007 Posted January 4, 2007 Assuming the cron job is in a web accessible folder, you could create a .php file in the same folder with the line "<?php echo $_SERVER['SCRIPT_FILENAME'] ?>". Then bring up the php file in a web browser and it will give you the file path. The error you originally reported, though, would indicate to me that bash can't find /usr/bin/php. If this is just a leased server, then the setup will be different depending on how your host has it setup. You could try calling just php without specifying the path. Quote
MikeJ Posted January 5, 2007 Posted January 5, 2007 and I'm getting the following error: /bin/sh: /usr/bin/php: No such file or directory This indeed is an error stating that /usr/bin/php does not exist. Since the hosting provider is not TCH, and uses H-Sphere for their control panel and not cPanel, you'll really need to ask your provider for the path information to where the PHP binary is. Quote
russellmcox Posted January 5, 2007 Author Posted January 5, 2007 This indeed is an error stating that /usr/bin/php does not exist. Since the hosting provider is not TCH, and uses H-Sphere for their control panel and not cPanel, you'll really need to ask your provider for the path information to where the PHP binary is. ---------------------------- I have since found out that TCH is not my host provider. A thousand pardons! However, you have done yourself proud in attempting to provide support for my issue. These days where I find myself talking to someone in Sri Lanka with barely passable language skills you guys are a breath of fresh air. I will not forget TCH when I find myself looking for a new hosting company! Regards, Russell Cox Quote
TCH-Bruce Posted January 5, 2007 Posted January 5, 2007 Not a problem. You can try: >php -q path-to-script It php is in a path cron can find it will run it. 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.