Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Run Controller method from command line

I have a simple "Hello World" Im trying to execute from the command line as per CI instructions

php index.php selection_schedule

I get this error

An uncaught Exception was encountered

Type: Error
Message: Call to undefined function uri_path()
Filename: /var/www/html/fuel/modules/fuel/hooks/Fuel_hooks.php
Line Number: 90

File: /var/www/html/fuel/modules/fuel/core/MY_Hooks.php
Line: 196
Function: offline

    File: /var/www/html/index.php
    Line: 375
    Function: require_once

Ideas on how to run from command line


  • Does your fuel/application/config/autoload.php file have url as one of the $autoload['helper']?

    the uri_path() function should automatically get loaded. FUEL extends the CI helper and includes that function in the fuel/application/helpers/MY_url_helper.php.

  • url is in the autoload['helper'] but the only thing in the fuel/application/helpers/MY_url_helper.php file is


    Nothing else.

  • If you follow that path, it will go to the file that has that function. I just created a simple "Test.php" controller and ran php index.php test and it worked fine without error so I'm unfortunately not sure why you'd be seeing that error.

  • I cannot run any controllers from command line if the environment is in production. It works fine in development. How can I over ride this to run fire off a controller from the command line php index.php Send_controller

Sign In or Register to comment.