icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » What could be wrong with this script?

PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >>

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old July 8th, 2008, 4:53 PM   #1 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Lives in Arnhem, the Netherlands
Hosted on SH98
2,451 posts
Gave thanks: 179
Thanked 42 times
What could be wrong with this script?

Code:
<?php
/*
RSS Feed Poster
Version 1.0.0
by:vbgamer45
http://www.smfhacks.com
*/

// SSI needed to get SMF functions
require('SSI.php');

// For the rss functions
require_once($sourcedir . '/Subs-RSS.php');

UpdateRSSFeedBots();
die($txt['smfrssposter_admin']);
?>
When executed by direct link it gives me an empty page, but that was expected. However, when I let it run through a cron-job I get:

Quote:
www/forum/cronrss.php: line 1: ?php: No such file or directory
www/forum/cronrss.php: line 2: /aquota.user: Permission denied
www/forum/cronrss.php: line 3: RSS: command not found
www/forum/cronrss.php: line 4: Version: command not found
www/forum/cronrss.php: line 5: by:vbgamer45: command not found
www/forum/cronrss.php: line 6: SMFHacks.com No such file or directory
www/forum/cronrss.php: line 7: access-logs/: is a directory
www/forum/cronrss.php: line 9: //: is a directory
www/forum/cronrss.php: line 10: syntax error near unexpected token `'SSI.php''
www/forum/cronrss.php: line 10: `require('SSI.php');'
It's for a feed poster for SMF.
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 8th, 2008, 5:54 PM   #2 (permalink)
Surpass Developer
On a golden path...
 
Mark's Avatar
 
Joined in Jan 2004
Lives in Florida
Hosted on decc.surpasshosting.com
493 posts
Gave thanks: 17
Thanked 76 times
Looks like it is not being interpreted through PHP. Can you paste the exact command you are using cron to execute?
__________________
Mark
Surpass Hosting Developer
sɹnoʎ uɐɥʇ ɹǝʇʇǝq sı bıs ʎɯ
Mark is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 9th, 2008, 1:45 AM   #3 (permalink)
Surpass Fan
Excelling Contributor
 
fury's Avatar
 
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
797 posts
Gave thanks: 41
Thanked 34 times
Like Mark said, could be a problem with the cronjob.

Code:
php /path/to/your/cron.php
Where the path starts with /home/

Probably like /home/cpanelusername/public_html/path/to/file

If the file is above public_html (non-public (a very good idea for some cronjobs)), just put in the path the same way.

I have a cron that makes backups to my remote server and the path is /home/rob/cron/backups/user1.php
__________________
fury™ - not helping the situation since 1987
robmonroe.net | | bullsux.com
fury is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 9th, 2008, 2:02 AM   #4 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Lives in Arnhem, the Netherlands
Hosted on SH98
2,451 posts
Gave thanks: 179
Thanked 42 times
20 * * * * www/forum/cronrss.php
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 9th, 2008, 2:10 AM   #5 (permalink)
Surpass Fan
Excelling Contributor
 
fury's Avatar
 
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
797 posts
Gave thanks: 41
Thanked 34 times
Quote:
Originally Posted by Edwin View Post
20 * * * * www/forum/cronrss.php
Yeah, that's formatted wrong.

Quote:
Originally Posted by fury View Post
Like Mark said, could be a problem with the cronjob.

Code:
php /path/to/your/cron.php
Where the path starts with /home/

Probably like /home/cpanelusername/public_html/path/to/file

If the file is above public_html (non-public (a very good idea for some cronjobs)), just put in the path the same way.

I have a cron that makes backups to my remote server and the path is /home/rob/cron/backups/user1.php
Should be more like:

Code:
20 * * * * php /home/public_html/USERNAME/public_html/forum/cronrss.php
Just make sure to replace USERNAME with your cPanel username.
__________________
fury™ - not helping the situation since 1987
robmonroe.net | | bullsux.com
fury is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 9th, 2008, 3:11 AM   #6 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Lives in Arnhem, the Netherlands
Hosted on SH98
2,451 posts
Gave thanks: 179
Thanked 42 times
Thanks. Will change this
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 9th, 2008, 3:50 AM   #7 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Lives in Arnhem, the Netherlands
Hosted on SH98
2,451 posts
Gave thanks: 179
Thanked 42 times
Quote:
Originally Posted by fury View Post
Yeah, that's formatted wrong.

Should be more like:

Code:
20 * * * * php /home/public_html/USERNAME/public_html/forum/cronrss.php
2 public_html? Removed the first public_html, and now it works. At least, I don't get the e-mails anymore I posted in the first topic. Now it's only that mysql keeps getting away.
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 9th, 2008, 3:54 AM   #8 (permalink)
Surpass Fan
Excelling Contributor
 
fury's Avatar
 
Joined in Dec 2005
Lives in MN > USA
Hosted on pass84
797 posts
Gave thanks: 41
Thanked 34 times
Yeah, that was a typo. You got it right.

And if you plan to run it every 20 minutes, I would leave the email blank when creating the cron. Otherwise it will send you an email every 20 minutes with the results of the cron job. Not really needed once you've confirmed it to be working.
__________________
fury™ - not helping the situation since 1987
robmonroe.net | | bullsux.com
fury is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old July 9th, 2008, 8:19 AM   #9 (permalink)
Surpassing Dutch
Super #1
 
Edwin's Avatar
 
Joined in Sep 2004
Lives in Arnhem, the Netherlands
Hosted on SH98
2,451 posts
Gave thanks: 179
Thanked 42 times
I turned the e-mail thingy off but thanks for the warning
__________________
sh98
Edwin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On