msdan Posted February 2, 2006 Posted February 2, 2006 (edited) Right now I have cron job for running some php script from a not password protected folder with next command: /usr/bin/php -q /home/cpanel_name/public_html/folder_not_protected/script.php > /dev/null What should I change in the command line if the folder where the php file is placed would be password protected? Thank you in advance Edited February 2, 2006 by msdan Quote
TCH-Bruce Posted February 2, 2006 Posted February 2, 2006 If you don't want anyone to be able to access the script.php file place it in a root folder (same level as public_html) then change your cron job to read. >/usr/bin/php -q /home/cpanel_name/folder-you-create/script.php > /dev/null That should be all you need to do. Quote
cajunman4life Posted February 2, 2006 Posted February 2, 2006 Also, if you set permissions to 600 on the file, that should help as well. Quote
spadin Posted March 23, 2006 Posted March 23, 2006 I am trying to do the exact same thing, I set it to email me the output and this is what I receive in the email. >Status: 404 Content-type: text/html No input file specified. This is what the file I'm trying to run does: ><?php // Load Site. $page = fopen("http://www.itrytoloadawebsite.com/", "r"); fclose($page); ?> Could the output I am receiving be the output from this script or is it an error with the cron tab? Quote
spadin Posted March 23, 2006 Posted March 23, 2006 I went ahead and added: > /dev/null to the end of the command that would run, I don't get an email anymore, however, I don't know if it is working or not. Quote
TCH-Bruce Posted March 23, 2006 Posted March 23, 2006 And what is it that your script is supposed to do? Quote
spadin Posted March 23, 2006 Posted March 23, 2006 (edited) Well, the script just loads another site. The reason being that the server where I have the other site doesn't have a cron tab. I put phpCron on the other site, but that still requires that the page be loaded in order for that cron to run. The solution I am using is really sloppy, but until the other site is moved to a server, like Total Choice which allows cron tabs, this is the only solution I have. The phpCron on the other site works, and what it does is check which users have something scheduled for that day and sends them an email reminder in the middle of the night. Edited March 23, 2006 by spadin 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.