【发布时间】:2011-12-02 09:38:29
【问题描述】:
我正在关注 this tutorial 通过 CLI 运行 Codeigniter。我已经完成了他们所做的一切(复制和粘贴),现在当我运行此命令时,除了输出网站索引内容外,它没有执行预期的操作。
$ cd /Users/MyUsername/Sites/code
$ php index.php tools message
我得到的输出是索引页面的 HTML 源,例如http://localhost/code.
预期的结果应该是
Hello World!
我怎样才能做到这一点才能让它发挥作用?
【问题讨论】:
-
你的 CodeIgniter 版本是多少?
-
当您在浏览器中访问工具/消息时,您会得到“Hello World!” ?
-
你试过 $this->input->is_cli_request() 吗?
-
可能解决方案是 stackoverflow.com/questions/10322587/… ,为我工作
标签: php codeigniter command-line-interface