Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.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
使用codeigniter的PhpStorm服务器_Codeigniter_Phpstorm - Fatal编程技术网

使用codeigniter的PhpStorm服务器

使用codeigniter的PhpStorm服务器,codeigniter,phpstorm,Codeigniter,Phpstorm,当使用IDE PhpStorm Codeigniter开发项目时,会出现这样的问题:如果我不生成服务器,则不会向我发送控制器的url以使用调试端口,如果我认为它也会给我一个服务器以访问故障。我不知道哪个是最佳设置 http://localhost:63342/U5AP1E2Alex/index.php (U5AP1E2Alex是项目的文件夹)没问题 http://localhost:63342/U5AP1E2Alex/index.php/tienda/index(控制器Tienda中的功能索引)

当使用IDE PhpStorm Codeigniter开发项目时,会出现这样的问题:如果我不生成服务器,则不会向我发送控制器的url以使用调试端口,如果我认为它也会给我一个服务器以访问故障。我不知道哪个是最佳设置

http://localhost:63342/U5AP1E2Alex/index.php
(U5AP1E2Alex是项目的文件夹)没问题

http://localhost:63342/U5AP1E2Alex/index.php/tienda/index
(控制器Tienda中的功能索引)未找到KO-404

如果我构建部署服务器,我也会遇到问题。。什么是更好的配置???

CodeIgniter 3v+常见检查404错误。

1:检查文件名是否有大写字母:

<?php

class Tienda extends CI_Controller {
    public function index() {

    }
}
Tienda.php

2:检查类名是否有大写字母:

<?php

class Tienda extends CI_Controller {
    public function index() {

    }
}
如果您的url
http://localhost:63342/U5AP1E2Alex/index.php/tienda/
index然后应该直接转到index函数,无需将函数索引放在url的末尾

您可能需要配置一些路由

或者如果在子文件夹中,即controllers>some_folder>Tienda.php

$route['tienda'] = 'some_folder/tienda/index';
更新:

如果您不需要在url中使用index.php,那么我建议您将其删除,方法如下所示

$config['index_page'] = '';

并在主目录中添加htaccess文件

使用合适的Apache/nginx/etc web服务器,而不是PhpStrom自己的简单内置web服务器(您现在正在使用)。谢谢,我按照您的说明进行了操作。现在唯一的失败是,如果我试图通过localhost/index.php(或直接通过PhpStorm的brownser链接)访问index.php,我引用的地址是localhost/xampp。@JulenMLejarza如果你不想在url中使用index.php,我已经更新了这个问题。此外,如果帮助充分,也不要参加投票或接受答案。
$config['index_page'] = '';