Tuesday, July 3, 2012

Codeigniter php frameworks: installation codeigniter part 1

Codeigniter php frameworks is back. I think, I must show you how to install codeigniter in your server, Or you can see at user guide codeigniter. First, download the latest version codeigniter from codeigniter.com, the same steps as I told in previous post . After that unzip the package, and upload the codeigniter folders and files to your server. Normaly the index.php file will be at your root. After that open the application/config/config.php file with your own text editor and set your base URL. If you intend to use encryption or sessions, set your encryption key. Keep in mind that the steps described by Codigniter php frameworks is references from http://codeigniter.com/user_guide/.

In the first paragraph you know how to install it, in the second paragraph Codeigniter php frameworks will be show you how to set the base url to automatically, you just have to change this variable $config[‘base_url’] at config.php file into this text bellow:

$config['base_url'] =  ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ?  "https" : "http");  $config['base_url'] .=  "://".$_SERVER['HTTP_HOST'];  $config['base_url'] .=  str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);

These code will generating base url to automatically, I think this code is very useful to you. So you must try it. How can I tell you these code is useful? Because, if you use the standard code of codeigniter, you should always change the “base url” configuration every time you move your codeigniter application. I think enough for today, see you in the next post of Codeigniter php frameworks.

No comments:

Post a Comment