Moodle: Command line scripts must define CLI_SCRIPT before requiring config.php

Trabla: Moodle: Command line scripts must define CLI_SCRIPT before requiring config.php
while calling php script via schell
php  my_script.php

Solving:

add into your file

define('CLI_SCRIPT',true);
require_once( dirname(__FILE__). '/../../config.php' )

No comments:

Post a Comment