2008-08-20, 10:41 AM
When I run a task out of the command-line with the follow commando:
I get the follow error:
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:
Replace with:
Now it will work:
[attachment=10657]
php /www/develop12_mybb140/task.php 4
I get the follow error:
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:
require_once "./inc/init.php";
Replace with:
require_once dirname(__FILE__)."/inc/init.php";
Now it will work:
[attachment=10657]