SMF Shop
SMFShop => Installation Problems => Topic started by: ProwlingTiger on May 23, 2007, 07:38:13 am
-
Okay, I set up a cron job with the dointerest.php file. I dont have cpanel, but it should work, shouldnt it?
My interest doesnt run, and I'm getting this error in my email daily:
sh: line 1: php: command not found
Cron Job:
php /home/***/www/forums/sources/shop/dointerest.php
dointerest.php:
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
| (c) 2005 DanSoft Australia |
| http://www.dansoftaustralia.com/ |
\**********************************************/
//File: dointerest.php
// The file to add interest to member's bank
//VERSION: 1.31 (Build 7)
//DATE: 10th December 2005
// $Id: dointerest.php 4 2006-07-08 10:09:08Z daniel15 $
if(!isset($_SERVER["HTTP_HOST"])) {
include("../../SSI.php");
$interest_rate = $modSettings['shopInterest'] / 100;
db_query("UPDATE {$db_prefix}members
SET moneyBank = moneyBank + (moneyBank*{$interest_rate})", __FILE__, __LINE__);
echo "Interest added at ".date("d/m/Y h:i:s A");
}
?>
I'd be more than willing to provide whatever files necessary to get this working.
-Dano
-
It sounds to me as though your server isn't configured to run php in a cron job...however there's an easy work-around already coded and offered by Daniel.
http://www.daniel15.com/forum/index.php/topic,31.0.html (http://www.daniel15.com/forum/index.php/topic,31.0.html)
The file Daniel offered there can be called via a cron job and will then get around the server restriction.
Use the following command:
wget -O - -q http://www.<your site>/<yourfile>.php
Basil Beard also offered a possible solution in the discussion on the link I gave above...there are several ways you could do it.
Hope this helps.
-
Instead of just "php", try /usr/bin/php and /usr/local/bin/php:
/usr/bin/php /home/***/www/forums/sources/shop/dointerest.php
-
Instead of just "php", try /usr/bin/php and /usr/local/bin/php:
/usr/bin/php /home/***/www/forums/sources/shop/dointerest.php
prowling is with dreamhost
http://wiki.dreamhost.com/Cron#Executing_a_PHP_Script_with_Crontabs
-
Instead of just "php", try /usr/bin/php and /usr/local/bin/php:
/usr/bin/php /home/***/www/forums/sources/shop/dointerest.php
Hmm..I tried that. I'm going to try feeble's suggestion now. I cant believe I missed that page of the wiki
-
Okay...I am really fed up with this. I'm pretty sure I've tried everything mentioned. If someone wants to be so kind and offer help, I can set up a FTP account, and whatever else to try and get this darn thing working.
-
I've been following your progress as I also use Dreamhost and, if you look at my earlier reply I gave you the way I got it to do what I needed.
I too wasted far too much time trying to sort out other methods and eventually decided to use the easy way out and not be too bothered about it.
-
I've been following your progress as I also use Dreamhost and, if you look at my earlier reply I gave you the way I got it to do what I needed.
I too wasted far too much time trying to sort out other methods and eventually decided to use the easy way out and not be too bothered about it.
Hmm..but you got it to work right? Mind if I send you screenshots of what I've got so far?
-
Not at all...and yes I've got it working with no problems thus far.
Just to make sure you're setting the file up properly...
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
| (c) 2005 DanSoft Australia |
| http://www.dansoftaustralia.net/ |
\**********************************************/
//File: dointerest.php
// The file to add interest to member's bank
//VERSION: 1.31 (Build 7)
//DATE: 10th December 2005
include("/home/.<server name>/<shell user name>/<domain name in the form of abc.com>/<directory for forum if not in root>/SSI.php");
$interest_rate = $modSettings['shopInterest'] / 100;
db_query("UPDATE {$db_prefix}members
SET moneyBank = moneyBank + (moneyBank*{$interest_rate})", __FILE__, __LINE__);
echo "Interest added at ".date("d/m/Y h:i:s A");
?>
-
Okay, well I woke up this morning and got an email saying it auto added interest. Cant tell you how much it pisses me off, as I have no clue what was wrong with it. But at least it works now. Thanks everyone for the help!
-
Your host should have an option to discard the message, rather than email it to you.
Otherwise, just remove this line from the PHP file:
echo "Interest added at ".date("d/m/Y h:i:s A");
This should not harm it in any way :)
-
Yeah I was considering removing that line, but now that I look, I've found the email notification option in my CP.
-
I tried to install using the regular cron job but no go.
I tried the script from above and no go
It keeps telling me
No such file or directory in /home/.c**/***/www.minemine.org/
SMF is installed in root folder along with TinyPortal, web host is Dreamhost, any ideas?
-
Is the path you're using correct? Go to the server settings part of the SMF admin panel, and check that the path is correct (if /home/.c**/***/www.minemine.org/ is the right path).
-
I copy and pasted that from admin > SMF directory
-
In that case, make sure you add the correct path to the end of it. In your case, I think it'd be /home/.c**/***/www.minemine.org/Sources/shop/dointerest.php :)
-
Its not working for me.
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
| (c) 2005 DanSoft Australia |
| http://www.dansoftaustralia.net/ |
\**********************************************/
//File: dointerest.php
// The file to add interest to member's bank
//VERSION: 1.31 (Build 7)
//DATE: 10th December 2005
include("/home/.<server name>/<shell user name>/<domain name in the form of abc.com>/<directory for forum if not in root>/SSI.php");
$interest_rate = $modSettings['shopInterest'] / 100;
db_query("UPDATE {$db_prefix}members
SET moneyBank = moneyBank + (moneyBank*{$interest_rate})", __FILE__, __LINE__);
echo "Interest added at ".date("d/m/Y h:i:s A");
?>
This one just says
Warning: include(/home/.caracal/lucapit/minemine.org/Sources/shop/dointerest.php) [function.include]: failed to open stream: No such file or directory in /home/.caracal/lucapit/www.minemine.org/Sources/shop/dointerest.php on line 14
Warning: include() [function.include]: Failed opening '/home/.caracal/lucapit/minemine.org/Sources/shop/dointerest.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.caracal/lucapit/www.minemine.org/Sources/shop/dointerest.php on line 14
Fatal error: Call to undefined function db_query() in /home/.caracal/lucapit/www.minemine.org/Sources/shop/dointerest.php on line 17
and the orignal one does absolutely nothing.
Any idea? :(
-
Warning: include(/home/.caracal/lucapit/minemine.org/Sources/shop/dointerest.php) [function.include]: failed to open stream: No such file or directory in /home/.caracal/lucapit/www.minemine.org/Sources/shop/dointerest.php on line 14
In the interest PHP file, change minemine.org to www.minemine.org :)
Edit: Just so I don't confuse you :P, the line in dointerest.php should look like:
include('/home/.caracal/lucapit/www.minemine.org/SSI.php');
-
yay it worked!!
Thanks Daniel, amazing script!!