• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fail when copying live site to localhost

#1
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.
Reply

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

#3
(03-13-2016, 07: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, 08: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?
Reply

#4
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?
Reply

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

#6
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.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#7
(03-13-2016, 11: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
Reply

#8
Hi,

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.