通过CLI运行Codeigniter输出网站根,而不是预期的结果 [英] Running Codeigniter via CLI outputs website root instead of expected result

查看:151
本文介绍了通过CLI运行Codeigniter输出网站根,而不是预期的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注通过CLI运行Codeigniter的本教程。我现在在运行此命令时已经完成了他们所做的一切(复制和粘贴),除非它输出网站索引内容,否则它不会做任何预期。

  $ cd / Users / MyUsername / Sites / code 
$ php index.php工具消息

我得到的输出是索引页HTML源,例如 http:// localhost / code



预期结果应为

  Hello World! 

如何实现这一功能,使其工作?

解决方案

请尝试:

  php index.php / controller / function / param1 / param2 / param3 etc 



p $ p> php index.php controller function param1 param2 param3 etc

,发布你的$ _SERVER变量的内容和来自config.php的'uri_protocol'变量的值。



$ config ['uri_protocol']应该是'AUTO' / p>

I'm following this tutorial on running Codeigniter via the CLI. I've done everything they've done (copied and pasted) now when I run this command, it doesn't do what is expected except it outputs the website index contents.

$ cd /Users/MyUsername/Sites/code
$ php index.php tools message

The output I get is the index page HTML source, e.g. http://localhost/code.

The expected result should be

Hello World!

How can I achieve this to make it work?

解决方案

try this:

php index.php/controller/function/param1/param2/param3 etc

or

php index.php controller function param1 param2 param3 etc

also, post the content of your $_SERVER var and value of the 'uri_protocol' variable from config.php.

$config['uri_protocol'] should be 'AUTO'

这篇关于通过CLI运行Codeigniter输出网站根,而不是预期的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆