xampp - How to run a codeigniter controller function using exec command in php -


i using xampp local window system. day working codeigniter, trying run mycontroller function background job. like

class admin extends mx_controller{     function __construct(){         parent::__construct();     }      function index(){         echo "working";         $command = "d:\xampp\php\php d:\xampp\htdocs\client\newslatter\index.php  admin preget";         echo $out = exec( $command);         echo "here";     }      function preget(){         echo "<br/>done!!!!!!";     } } 

i not able run function using exec command can 1 out problem?.

codeigniter has page in it´s manual this:

http://ellislab.com/codeigniter/user-guide/general/cli.html

note that, in command, put path file, didn´t add "php"

$command = "php d:\xampp\php\php d:\xampp\htdocs\client\newslatter\index.php admin preget";

maybe solve problem.

is php.exe in "path" enviroment variable of windows?

the process should pretty easy: run > "cmd" in windows , navigate codeigniter project.

$ cd /path/to/project; $ php index.php yourcontroller controllermethod


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -