Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在Ubuntu中运行CodeIgniter项目_Php_Codeigniter_Ubuntu - Fatal编程技术网

Php 在Ubuntu中运行CodeIgniter项目

Php 在Ubuntu中运行CodeIgniter项目,php,codeigniter,ubuntu,Php,Codeigniter,Ubuntu,我在windows环境中的Codeigniter中有一个现有项目,最近我切换到Ubuntu,只要我输入“”或“”,就会出现Codeigniter中的404。我认为问题在于它无法从项目中读取任何控制器。试试这个, is your localhost is working ? if not then you have to make an entry into hosts file.open terminal with super user like this type ctrl + alt +

我在windows环境中的Codeigniter中有一个现有项目,最近我切换到Ubuntu,只要我输入“”或“”,就会出现Codeigniter中的404。我认为问题在于它无法从项目中读取任何控制器。

试试这个, is your localhost is working ?
if not then you have to make an entry into hosts file.
open terminal with super user like this type ctrl + alt + t(terminal) and
type gedit /etc/hosts then enter 127.0.0.1 localhost 您的本地主机工作正常吗
如果没有,则您必须在主机文件中输入一个条目。
使用超级用户打开终端,如ctrl+alt+t(终端)和
键入gedit/etc/hosts,然后输入127.0.0.1 localhost还可以检查您的url,如, is your localhost is working ?
if not then you have to make an entry into hosts file.
open terminal with super user like this type ctrl + alt + t(terminal) and
type gedit /etc/hosts then enter 127.0.0.1 localhost
您的本地主机工作正常吗
如果没有,则您必须在主机文件中输入一个条目。
使用超级用户打开终端,如ctrl+alt+t(终端)和
键入gedit/etc/hosts,然后输入127.0.0.1 localhost并检查您的url,如

尝试访问
http://localhost
。行吗?不行。我试着安装另一个codeigniter repo来检查这个问题是否在我的项目中。欢迎页面可以工作,但当我创建自定义控制器时,它返回404。我认为问题在于返回自定义控制器。必须以大写字母开头。对于ex::controller.phpFirst,请确保您已在config.php示例
$config['base\u url']='http://localhost/yourproject/';
然后确保文件名和类名的首字母仅为大写,其余为小写。对于运行CodeIgniter项目,Ubuntu需要在项目根文件夹中打开重写模式的.htaccess文件。请尝试访问
http://localhost
。行吗?不行。我试着安装另一个codeigniter repo来检查这个问题是否在我的项目中。欢迎页面可以工作,但当我创建自定义控制器时,它返回404。我认为问题在于返回自定义控制器。必须以大写字母开头。对于ex::controller.phpFirst,请确保您已在config.php示例
$config['base\u url']='http://localhost/yourproject/';
然后确保文件名和类名的首字母大写,其余小写。Ubuntu需要在项目根文件夹中的.htaccess文件,运行CodeIgniter项目时启用重写模式。