如何使用codeigniter CLI

如何使用codeigniter CLI,codeigniter,command-line-interface,Codeigniter,Command Line Interface,我是使用codeigniter cli的新手 我正在使用xampp,我的项目位于 c:\xampp\htdocs\mycli\ 我的代码是这样的 public function myfunction($to = "WORLD"){ echo "HELLO {$to}!".PHP_EOL; } 我试图在cli上使用基于codeigniter教程的cmd行 c:\xampp\htdocs\my_cli\index.php mycontroller myfunction "test" 但它不工

我是使用codeigniter cli的新手 我正在使用xampp,我的项目位于

c:\xampp\htdocs\mycli\
我的代码是这样的

public function myfunction($to = "WORLD"){
 echo "HELLO {$to}!".PHP_EOL;
}
我试图在cli上使用基于codeigniter教程的cmd行

c:\xampp\htdocs\my_cli\index.php mycontroller myfunction "test"
但它不工作,它只是显示index.php文件。我还使用htacess删除url中的index.php

cd /path/to/project
php index.php mycontroller myfunction test

您可以执行
php index.php控制器操作

或者您可以称之为http协议

wget http://example.com/example/test/bar/


curl http://example.com/example/test/bar/
参考:步骤1:cmd

第二步:检查你的命令->

"php -V"


if step2 got error: your php.exe is not in your sys's path{
  step3: 
c:\xampp\php\php c:\xampp\htdocs\my_cli\index.php mycontroller myfunction "test"
}
if step2 show like this: php 5.3.6 ...............{
  step3 is:
php c:\xampp\htdocs\my_cli\index.php mycontroller myfunction "test"
}

您是否将您的控制器命名为mycontroller.php,并且在该控制器
类中mycontroller扩展了CI_控制器
??检查-文件名和类声明的大小写。还有,你是我的使命!在{$to}yes之后,我的控制器是Mycontroller.php,类Mycontroller扩展了CI_controller。它只是一直在打开index.php,我是否需要配置才能使用CLI??TNX