Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter project localhost to live server transfer
#1

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

(This post was last modified: 04-28-2015, 05:58 PM by InsiteFX.)

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

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 04-29-2015, 07:46 PM by John_Betong. Edit Reason: spelling: not my fortay )

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

You can also try changing this:

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

To one of the other ones.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

Did everything you said, but 404 not found !
Reply
#6

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

(This post was last modified: 04-30-2015, 12:28 PM by s4dman.)

(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
Reply
#8

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'
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#9

(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
Reply
#10

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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB