Welcome Guest, Not a member yet? Register   Sign In
Facing Problems
#1

(This post was last modified: 12-31-2023, 12:10 AM by ozornick. Edit Reason: Delete link )

I'm preparing to launch my website but I encounter a challenge: each time I upload the site from my local machine to the server, I have to adjust the config file. However, when I run it locally again, I need to reset the config once more. I'm curious if there's an alternative solution to tackle this problem. 

Thank you!"
Vijay
Reply
#2

Use .env file for configuration
Simple CI 4 project for beginners codeigniter-expenses
Reply
#3

The only thing I have to do when I ftp my new site up to the server is just change the config base_url.
What did you Try? What did you Get? What did you Expect?

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

To avoid this, I make different versions of my .env file: I have a local one .env I use for development, one named .env-staging and one .env-production for the two other environments I use. When I deploy my project, depending on the environment, i rename the config I need into the .env file for the environment. I don't know if that is best practice – I have seen some security concerns when having config files inside version control systems... but it works great for me as I only use private repositories and I like the automation I can use for that task.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB