-->

Codeigniter + GoCart CMS + Dreamhost (Shared Hosti

2019-09-01 16:34发布

问题:

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!