Codeigniter + GoCart CMS + Dreamhost (Shared Hosting) says “Unable to locate the model you have specified…”

浪子不回头ぞ 提交于 2019-12-12 05:20:39

问题


I have been working on a site locally (WAMP) and it's worked 100%. Now I'm trying to put it online on the client's Dreamhost server and it's been giving me 5 days of problems.

However, on the index.php page, it reads:

An Error Was Encountered Unable to locate the model you have specified: Settings

The structure of the server is:

  • home
    • user
      • domain1.com
        • application/
        • system/
        • 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}::$1 ^(.*?/)(.*)::\2$
RewriteRule ^(.*)$ - [E=BASE:%1]
RewriteBase /home/user/domain1.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ %{ENV:BASE}/index.php?/$1 [L,QSA]

In config.php, my base_url is:

$config['base_url'] = 'domain1.com';

And the place where the unfound Settings model is being called is located in GoCart's application/controllers/Bootstrap.php file around line 143. It reads

    //autoload some libraries here.
    $this->load->model('Settings');
    $this->load->library(['session', 'auth', 'form_validation']);
    $this->load->helper(['file', 'string', 'html', 'language', 'form', 'formatting']);

Because I am using the GoCart CMS, Settings.php is not in the models folder, but it is in application/modules/settings/models.

That's about the only info I can provide. I'm not sure what's going wrong between the local version and the web version, but I've found a lot of articles and forum posts about Dreamhost causing issues with CodeIgniter. I think it works with CodeIgniter, but now GoCart is causing some issue, and GoCart unfortunately is not as documented as CodeIgniter (so answers are harder to find).

Any ideas?


回答1:


For future reference: GoCart CMS creates a manifest file (application/config/manifest.php) which overrides other routes and documents the URLs of all the controllers it uses. Apparently, when you install GoCart on a local server, it sets up local paths to the files and these were being used on the web server. I deleted manifest.php and GoCart rewrote a new one. Now it works!



来源:https://stackoverflow.com/questions/33990325/codeigniter-gocart-cms-dreamhost-shared-hosting-says-unable-to-locate-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!