【问题标题】:codeigniter- object not found -base_urlcodeigniter-找不到对象-base_url
【发布时间】:2017-02-17 11:52:06
【问题描述】:

找不到对象!

在此服务器上找不到请求的 URL。引用页面上的链接似乎是错误的或过时的。请将该错误告知该页面的作者。

如果您认为这是服务器错误,请联系网站管理员。

错误 404

localhost Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.24

配置:

$config['base_url'] = 'http://localhost/1/';

自动加载

$autoload['helper'] = array('url', 'form', 'html');

site_url 对我有用,但是当我使用 base_url 时它不起作用。 我更喜欢使用 base_url() 而不是 site_url。

如何运行我的代码?

【问题讨论】:

  • 您在哪里以及如何使用site_url/base_url,您使用的是哪个变量或函数?我在您的问题中没有看到任何有问题的代码。

标签: php codeigniter controller base-url


【解决方案1】:

我认为你的配置有问题, 你可以替换

$config['base_url'] = 'http://localhost/1/';

$config['base_url'] = 'http://localhost';

或者

$config['base_url'] = 'http://localhost/Yoursite';

希望这能正常工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-26
    • 2014-02-26
    • 1970-01-01
    • 1970-01-01
    • 2018-05-24
    • 1970-01-01
    • 2013-05-16
    • 2015-02-09
    相关资源
    最近更新 更多