CodeIgniter Forums
Fail when copying live site to localhost - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Fail when copying live site to localhost (/showthread.php?tid=64624)



Fail when copying live site to localhost - wlwan - 03-13-2016

Dears,
I'm running CodeIgniter 2.1.0 on Linux server with php and mysql enabled. 
Now would like to copy the live site to my localhost for development. 
Have double checked and the server, php and mysql version are all the same as the live site.

Then I import the database and paste all the source code there. 
Result: Server Error 500

------------------------
I did rename the database username, password and database name, 
hv updated all those field on config/database.php

Have created a test php file and it can show the fields in the database
---------------------------
Code:
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'newname';
$db['default']['password'] = 'newpd';
$db['default']['database'] = 'newdb';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;


Code:
if(empty($_SERVER["HTTPS"])) {
   $config['base_url']    = 'index.php';
} else {
   $config['base_url']    = 'index.php';
}

Any idea what's going on? Thanks for your time.


RE: Fail when copying live site to localhost - JayAdra - 03-13-2016

Check your error logs. They'll tell you more than we could right now.


RE: Fail when copying live site to localhost - wlwan - 03-13-2016

(03-13-2016, 06:56 PM)wlwan Wrote: Dears,
I'm running CodeIgniter 2.1.0 on Linux server with php and mysql enabled. 
Now would like to copy the live site to my localhost for development. 
Have double checked and the server, php and mysql version are all the same as the live site.

Then I import the database and paste all the source code there. 
Result: Server Error 500

------------------------
I did rename the database username, password and database name, 
hv updated all those field on config/database.php

Have created a test php file and it can show the fields in the database
---------------------------
Code:
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'newname';
$db['default']['password'] = 'newpd';
$db['default']['database'] = 'newdb';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;


Code:
if(empty($_SERVER["HTTPS"])) {
   $config['base_url']    = 'index.php';
} else {
   $config['base_url']    = 'index.php';
}

Any idea what's going on? Thanks for your time.

(03-13-2016, 07:26 PM)JayAdra Wrote: Check your error logs. They'll tell you more than we could right now.

Did check and find no logs records... do i need to enable anything to make it track?


RE: Fail when copying live site to localhost - wlwan - 03-13-2016

Did have a check...
saying can't find the tc folder..

Here's the case, not sure is by codeigniter or custom coding....
when visitor go to [my domain], it will go to [my domain]/tc to show content in traditional chinese as default language...

checked and find the /application/language/tc have some files

any ideas how codeigniter deal with multi-language?


RE: Fail when copying live site to localhost - JayAdra - 03-13-2016

Spend some time with the user guide:
http://www.codeigniter.com/userguide3/


RE: Fail when copying live site to localhost - InsiteFX - 03-13-2016

Check your index.php file and make sure that the system and application folders are pointing to the correct location.

Server 500 is an Apache server error not CodeIgniter.


RE: Fail when copying live site to localhost - wlwan - 03-13-2016

(03-13-2016, 10:31 PM)InsiteFX Wrote: Check your index.php file and make sure that the system and application folders are pointing to the correct location.

Server 500 is an Apache server error not CodeIgniter.

I think the system and application path should be fine... 

Here's the code @index.php
Code:
    $system_path = 'system';
    $application_folder = 'application';

While the structure is as below:

Root
/application/
      /controllers/
      /controllers/index.php
      /views/
      /views/index.php
/system/
/css/
/images/
...
/index.php


RE: Fail when copying live site to localhost - salain - 03-13-2016

Hi,

You probably have a redirect from [my domain] to [my domain]/tc in your .htaccess file.