Current time: 05-24-2012, 06:30 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Task System out of a cronjob
08-20-2008, 10:41 AM
Post: #1
[F] Task System out of a cronjob
When I run a task out of the command-line with the follow commando:
Code:
php /www/develop12_mybb140/task.php 4

I get the follow error:
Code:
Warning: require_once(./inc/init.php): failed to open stream: No such file or directory in /www/develop12_mybb140/task.php on line 20

Fatal error: require_once(): Failed opening required './inc/init.php' (include_path='.:/usr/share/php:/usr/share/pear') in /www/develop12_mybb140/task.php on line 20

It seems that PHP doesn't like relative requires out of the commandline when you aren't in that directory. And, that's difficult when you run it out of the commandline.

When you go to the directory and run the command, you don't get an error, and the process succeed.

So, the relative require has to be changed. Open task.php and find:
PHP Code:
require_once "./inc/init.php"

Replace with:
PHP Code:
require_once dirname(__FILE__)."/inc/init.php"

Now it will work:
   

http://www.gamesection.org
http://www.Online-Urbanus.be
http://www.MyBBDesign.com
[Image: mybbsig.php]
Visit this user's website Find all posts by this user
08-21-2008, 08:32 PM
Post: #2
[F] Task System out of a cronjob
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication