• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how set CI_ENV for codeigniter

#1
Hi
According to CI_ENV parameter,we can change environment codeigniter
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');

But how i can set this variable on host?
Reply

#2
Add this to the top of your .htaccess file in the root.

PHP Code:
SetEnv CI_ENV development
#SetEnv CI_ENV production 

Un-remark and remark the one you to use
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(09-03-2019, 02:50 AM)InsiteFX Wrote: Add this to the top of your .htaccess file in the root.

PHP Code:
SetEnv CI_ENV development
#SetEnv CI_ENV production 

Un-remark and remark the one you to use
Thank you it's working good
Reply

#4
If you are in control of the webserver it is better to use server config files than to use .htaccess. In truth, there really isn't a reason to use .htaccess at all because all directive will be supplied much more efficiently from config files.

.htaccess hits tend to add up because each time the server read a directory it must open and evaluate the .htaccess file if it is there. Config files, on the other hand, are read once when the web server starts up and the directives are kept in memory.

.htaccess exists to allow purchasers of space on a shared server at least at tiny be of control. But it's performance sucking sponge.
Reply

#5
(09-03-2019, 06:58 AM)dave friend Wrote: If you are in control of the webserver it is better to use server config files than to use .htaccess. In truth, there really isn't a reason to use .htaccess at all because all directive will be supplied much more efficiently from config files.

.htaccess hits tend to add up because each time the server read a directory it must open and evaluate the .htaccess file if it is there. Config files, on the other hand, are read once when the web server starts up and the directives are kept in memory.

.htaccess exists to allow purchasers of space on a shared server at least at tiny be of control. But it's performance sucking sponge.
Thank you so much
Reply

#6
Setting up CodeIgniter multiple environments is fairly easy and supported by default in the framework. However it requires you to define your environment in a core file instead of setting it up to recognize the url which can cause several issues McDVOICE
Reply

#7
(01-28-2020, 04:22 AM)Goldberg Wrote: Setting up CodeIgniter multiple environments is fairly easy and supported by default in the framework. However it requires you to define your environment in a core file instead of setting it up to recognize the url which can cause several issues mcdvoice
mybkexperience
CodeIgniter, while not as new as other PHP frameworks, is still a great platform for developing client web applications. One thing we do for every project at Anecka is configure a local, stage and production environment. This helps us a lot when we have to maintain the project after launch as we have separate environments for developing and testing features. CodeIgniter is great because it supports multiple environments out of the box.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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