Codeigniter + GoCart CMS + Dreamhost(共享主机)说 "Unable to locate the model you have specified..."
Codeigniter + GoCart CMS + Dreamhost (Shared Hosting) says "Unable to locate the model you have specified..."
我一直在本地 (WAMP) 网站上工作,并且 100% 有效。现在我正试图将它放在客户端的 Dreamhost 服务器上,它已经给我 5 天的问题。
但是,在 index.php 页面上显示:
An Error Was Encountered
Unable to locate the model you have specified: Settings
服务器的结构是:
- 家
- 用户
- domain1.com
- 申请/
- 系统/
- index.php
- domain2.com
.htaccess:
Options +FollowSymLinks
AuthType Basic
AuthName "Restricted Access"
AuthUserFile "/home/user/domain1.com/.htpasswd"
Require valid-user
RewriteEngine On
RewriteCond %{REQUEST_URI}:: ^(.*?/)(.*)::$
RewriteRule ^(.*)$ - [E=BASE:%1]
RewriteBase /home/user/domain1.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ %{ENV:BASE}/index.php?/ [L,QSA]
在config.php中,我的base_url
是:
$config['base_url'] = 'domain1.com';
调用未找到的设置模型的地方位于 GoCart 的 application/controllers/Bootstrap.php 文件第 143 行左右。它显示为
//autoload some libraries here.
$this->load->model('Settings');
$this->load->library(['session', 'auth', 'form_validation']);
$this->load->helper(['file', 'string', 'html', 'language', 'form', 'formatting']);
因为我使用的是GoCart CMS,所以Settings.php不在模型文件夹中,而是在application/modules/settings/models中。
这是我能提供的唯一信息。我不确定本地版本和网络版本之间出了什么问题,但我发现很多关于 Dreamhost 的文章和论坛帖子导致 CodeIgniter 出现问题。我认为它适用于 CodeIgniter,但现在 GoCart 引起了一些问题,不幸的是,GoCart 没有像 CodeIgniter 那样记录(因此更难找到答案)。
有什么想法吗?
供将来参考:GoCart CMS 创建一个清单文件 (application/config/manifest.php),它会覆盖其他路由并记录它使用的所有控制器的 URL。显然,当您在本地服务器上安装 GoCart 时,它会设置文件的本地路径,并且这些文件在 Web 服务器上使用。我删除了 manifest.php 并且 GoCart 重写了一个新的。现在可以了!
我一直在本地 (WAMP) 网站上工作,并且 100% 有效。现在我正试图将它放在客户端的 Dreamhost 服务器上,它已经给我 5 天的问题。
但是,在 index.php 页面上显示:
An Error Was Encountered
Unable to locate the model you have specified: Settings
服务器的结构是:
- 家
- 用户
- domain1.com
- 申请/
- 系统/
- index.php
- domain2.com
- domain1.com
- 用户
.htaccess:
Options +FollowSymLinks
AuthType Basic
AuthName "Restricted Access"
AuthUserFile "/home/user/domain1.com/.htpasswd"
Require valid-user
RewriteEngine On
RewriteCond %{REQUEST_URI}:: ^(.*?/)(.*)::$
RewriteRule ^(.*)$ - [E=BASE:%1]
RewriteBase /home/user/domain1.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ %{ENV:BASE}/index.php?/ [L,QSA]
在config.php中,我的base_url
是:
$config['base_url'] = 'domain1.com';
调用未找到的设置模型的地方位于 GoCart 的 application/controllers/Bootstrap.php 文件第 143 行左右。它显示为
//autoload some libraries here.
$this->load->model('Settings');
$this->load->library(['session', 'auth', 'form_validation']);
$this->load->helper(['file', 'string', 'html', 'language', 'form', 'formatting']);
因为我使用的是GoCart CMS,所以Settings.php不在模型文件夹中,而是在application/modules/settings/models中。
这是我能提供的唯一信息。我不确定本地版本和网络版本之间出了什么问题,但我发现很多关于 Dreamhost 的文章和论坛帖子导致 CodeIgniter 出现问题。我认为它适用于 CodeIgniter,但现在 GoCart 引起了一些问题,不幸的是,GoCart 没有像 CodeIgniter 那样记录(因此更难找到答案)。
有什么想法吗?
供将来参考:GoCart CMS 创建一个清单文件 (application/config/manifest.php),它会覆盖其他路由并记录它使用的所有控制器的 URL。显然,当您在本地服务器上安装 GoCart 时,它会设置文件的本地路径,并且这些文件在 Web 服务器上使用。我删除了 manifest.php 并且 GoCart 重写了一个新的。现在可以了!