CodeIgniter Forums
CodeIgniter project localhost to live server transfer - 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: CodeIgniter project localhost to live server transfer (/showthread.php?tid=61588)

Pages: 1 2


CodeIgniter project localhost to live server transfer - s4dman - 04-28-2015

I want to transfer my CI project from localhost to a live server, so I copied all my project folders of CI to the public_html folder using FTP Client.

Here's how it look :

[Image: F6mh0.jpg]

I modified the config.php, base_url, .htaccess as needed. But nothing's working.

If any problem in my .htaccess codes:

PHP Code:
RewriteEngine On
RewriteBase 
/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$[L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$[L]

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

config.php:

Code:
$config['base_url'] = 'http://xxxxxxxx.com/';

The Others directory contains my css/js/img files, and all are invoked using base_url(), so I don't think that's a problem.


RE: CodeIgniter project localhost to live server transfer - InsiteFX - 04-28-2015

This is how I do it for local and live server.

PHP Code:
application
system
public_html
assets
-- css
-- js
-- img
-- images
-- etc;
-
index.php 

you need to edit the index.php file and add ../ to the application and system folder names ../application ../system

This way your application and system directories are in the root of your server.


RE: CodeIgniter project localhost to live server transfer - John_Betong - 04-29-2015

As far as your online version not working try the following:

1. if you use a database, make sure your connection is OK.
2. temporarily remove/rename .htaccess file. (index.php should work)
3. check your error logs
4. check the php_errors file.
5. temporarily change your index.php ENVIRONMENT constant to 'development'.

I prefer having all my files in a single "version-001" directory. It does mean changing the following 

$application_path = "version-001"; // default = 'application';

The main advantage is you can work on your next "version-002", upload and if there are any problems change back to your original version.



RE: CodeIgniter project localhost to live server transfer - InsiteFX - 04-29-2015

You can also try changing this:

PHP Code:
$config['uri_protocol']    = 'AUTO'

To one of the other ones.


RE: CodeIgniter project localhost to live server transfer - s4dman - 04-30-2015

Did everything you said, but 404 not found !


RE: CodeIgniter project localhost to live server transfer - CroNiX - 04-30-2015

Are all of your filenames properly cased as mentioned in the user guide? It doesn't matter for some OS's (maybe your dev OS), but on others it does (maybe your production OS).


RE: CodeIgniter project localhost to live server transfer - s4dman - 04-30-2015

(04-30-2015, 09:48 AM)CroNiX Wrote: Are all of your filenames properly cased as mentioned in the user guide? It doesn't matter for some OS's (maybe your dev OS), but on others it does (maybe your production OS).

Everything's good. I just can't figure out where is the problem. There's not enough tutorial on the internet also.

Ok, a quick review what I did :

folder tree :
PHP Code:
/
application
system
public_html
   
-- all the other folder and files 


index.html file: system and application folder path : ../system ../application

.htaccess codes :

PHP Code:
RewriteEngine On
RewriteBase 
/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$[L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$[L]

RewriteCond %{REQUEST_FILENAME} !-

base_url : my site address - http://xxxx.com/
index_page : removed
autoload default controller : my Main controller which im working with
database connection : credentials checked Ok


RE: CodeIgniter project localhost to live server transfer - InsiteFX - 04-30-2015

base_url should be like this: http://www.xxxx.com/

system and application folder path : ../system ../application needs to be updated in your index.php file

index.php

PHP Code:
/*
 *---------------------------------------------------------------
 * SYSTEM FOLDER NAME
 *---------------------------------------------------------------
 *
 * This variable must contain the name of your "system" folder.
 * Include the path if the folder is not in the same directory
 * as this file.
 */
    
$system_path '../system';

/*
 *---------------------------------------------------------------
 * APPLICATION FOLDER NAME
 *---------------------------------------------------------------
 *
 * If you want this front controller to use a different "application"
 * folder than the default one you can set its name here. The folder
 * can also be renamed or relocated anywhere on your server. If
 * you do, use a full server path. For more info please see the user guide:
 * http://codeigniter.com/user_guide/general/managing_apps.html
 *
 * NO TRAILING SLASH!
 */
    
$application_folder '../application'



RE: CodeIgniter project localhost to live server transfer - s4dman - 05-01-2015

(04-30-2015, 10:56 PM)InsiteFX Wrote: base_url should be like this: http://www.xxxx.com/

system and application folder path : ../system ../application needs to be updated in your index.php file

index.php


PHP Code:
/*
 *---------------------------------------------------------------
 * SYSTEM FOLDER NAME
 *---------------------------------------------------------------
 *
 * This variable must contain the name of your "system" folder.
 * Include the path if the folder is not in the same directory
 * as this file.
 */
 
$system_path '../system';

/*
 *---------------------------------------------------------------
 * APPLICATION FOLDER NAME
 *---------------------------------------------------------------
 *
 * If you want this front controller to use a different "application"
 * folder than the default one you can set its name here. The folder
 * can also be renamed or relocated anywhere on your server. If
 * you do, use a full server path. For more info please see the user guide:
 * http://codeigniter.com/user_guide/general/managing_apps.html
 *
 * NO TRAILING SLASH!
 */
 
$application_folder '../application'

Ya bro did the same ! Sad


RE: CodeIgniter project localhost to live server transfer - sintakonte - 05-06-2015

put a test.php file on the same directory where the CI index.php is and try to call it from a browser
if you get a 404 you can be sure this isn't a CI problem at all rather than a wrong configured web server