Welcome Guest, Not a member yet? Register   Sign In
Trying to copy working website from server to localhost

I have a site that works on hostgator but instead of testing on the live site, I want to copy things locally.

I successfully loaded XAMPP and CI but couldn't get my site to work. I tried various changes to config files and .htaccess etc, but no luck. So I decided to try WAMP instead. Again, successfully installed WAMP, turned on rewrite_module for Appache and dropped the entire CI folder "CodeIgniter" into WAMP's www and I also imported the databases successfully.

This is the .htaccess from the hostgator server

RewriteEngine On
RewriteBase /
#also tried RewriteBase /CodeIgniter
#also tried RewriteBase /CodeIgniter/

# REDIRECT sitemap.xml
RewriteCond $1 ^sitemap.xml
RewriteRule ^(.*)$ /index.php/sitemapxml [L]

# REDIRECT TO WWW. used on production site
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [L,R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

# AddHandler php5-script .php

But I keep getting: could not find www.localhost

When I changed to what I see posted in the forum:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

I get a page of text like this:

load->model('settings_model'); $this->client = $this->settings_model->get('1'); // print_r($this->client); /

And then this error:

( ! ) Fatal error: Class 'MY_Controller' not found in C:\wamp\www\CI\application\controllers\homepage.php on line 3
Call Stack
# Time Memory Function Location
1 0.0034 149424 {main}( ) ..\index.php:0
2 0.0050 185904 require_once( 'C:\wamp\www\CI\system\core\CodeIgniter.php' ) ..\index.php:208
3 0.9025 669736 include( 'C:\wamp\www\CI\application\controllers\homepage.php' ) ..\CodeIgniter.php:250

The second line seems strange because it's requesting a file CodeIgniter.php from my core, which doesn't exist. No matter what I change the name of my CI folder, I still get the same error. The only things in my core are index.html, MY_Controller.php and MY_Model.php, which is all I see on my production server too.

Any suggestions?

Does line 3 of your homepage-controller say
class Homepage extends MY_Controller

If so, you must have a MY_Controller somewhere in your folders on the production system.

Otherwise it might just be a permissions problem, I'd say.

Yes, the 3rd line says that. I'll look into permissions.

Still having trouble. Not sure how to check permissions since it is localhost and I am the admin on the computer. CI sees the database because my programs says it can't find it if I move it. Anyway, There is no misspelling and the file is in core. But here is the odd part:

It'is displaying all the text of MY_Controller, then saying it cannot find it when it gets to homepage.php.

When I added an include statement on top of homepage it displayed MY_Controller twice, then crashed at the same point again.

It must be my laptop, windows xp because another person simply dropped it on his computer, in WAMP, and it worked for him, and I get the same exact error whether in WAMP or XAMPP.

Any other suggestions on what to check on my computer?

SOLVED... The original coder used this at the top


Instead of


Theme © iAndrew 2016 - Forum software by © MyBB