anon271334
anon271334

Reputation:

Installing CodeIgniter

I am wanting to install CodeIgnitor on my hosting account, but I'm a little confused.

The documentation says:

"CodeIgniter is installed in four steps:

1.Unzip the package.

2.Upload the CodeIgniter folders and files to your server. Normally the index.php file will be at your root.

3.Open the application/config/config.php file with a text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key."

I'm having trouble getting my head around No. 2; It says to chuck everything into the root dir of my server, which is fine, I can do that, BUT, the codeigniter files that I upload also has an index.php page.

And my website files are also located in the root folder. If I upload all the codeigniter files to my root dir, and replace the default index.php file that codeigniter tells me to upload with my own websites index.php file? Is that what you're supposed to do?

Thanks :)

Upvotes: 1

Views: 2641

Answers (4)

Alok
Alok

Reputation: 1

First of all back up all your existing files in your root folder, Install Codeigniter following the guide which is located at https://ellislab.com/codeigniter/user-guide/installation/.

Your index.php file is different when compared with Codeigniter index.php file, Codeigniter uses index.php file as a config file to set the required paths and to load different classes including Router, this way the default Welcome page is loaded indicating proper installation of Codeigniter.

You can later place the application and system folder out of your public directory, while changing the settings in Codeigniter's index.php file

Upvotes: 0

Kinjal Dixit
Kinjal Dixit

Reputation: 7935

another way of doing this is to first through your control panel is to create a subdomain like myci.yoursite.com, and select the folder for it as /var/www/myci (which would usually be automatic)

upload unzipped codeigniter files in /var/www/myci. if any default index.php is created there it is usually safe to overwrite it. if any default index.html etc is created you may have to delete them. any cgi-bin etc can be safely left untouched.

you should be able to see your site as http://myci.yoursite.com/

one of the first things you should do is edit your system/application/config/config.php and correct the $config['base_url']

Upvotes: 1

Brad
Brad

Reputation: 1691

Please note that the CI index page is a config page, not a welcome page. Your "real" index page is NOT the index page that you are thinking it is.

Your site address should be like this

www.sitename.com/index.php/main

main is simply the controller name that calls the opening page.(I use main, you can use any name you want)

if Main is your controller that points to the opening page,m you would name youre first function in the main controller "index"

Class Main extends controller{
function index(){
$this->load->view('main page name'); 
}
}

All pages views in CI are called by a controller, there are no free floating pages

Upvotes: 0

simshaun
simshaun

Reputation: 21466

If you are using your current website, you may not want to replace the index.php until your new website is ready to go live. If you are trying to tie the two together, I recommend fully porting your current website in to CodeIgniter if at all possible.

Otherwise, I recommend installing CodeIgniter in a folder under the root directory and modifying its config file to point to it.

Upvotes: 1

Related Questions