CodeIgniter Forums
Fresh install, CI_DEVELOPMENT in .env not work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Fresh install, CI_DEVELOPMENT in .env not work (/showthread.php?tid=89272)



Fresh install, CI_DEVELOPMENT in .env not work - okiewardoyo - 02-01-2024

Dear all, i have just fresh install of Codeigniter from composer. After installation, i go to env, rename it to .env and uncomment CI_ENVIRONMENT = development.
But when i do "php spark serve" from terminal, it open localhost:8080 with "Page rendered in 0.0455 seconds Environment: production" in it footer page. Look like changing configuration in .env doesn't work anymore.
Is there anysolution? Thanks.
Look Page rendered in 0.0455 seconds

Environment: production
Page rendered in 0.0455 seconds

Environment: production


RE: Fresh install, CI_DEVELOPMENT in .env not work - luckmoshy - 02-02-2024

You are fine since you got that home Nothing is next, right? Please learn how to create an app with Codeigniter 4. Go here and start learning.


https://codeigniter.com/user_guide/tutorial/static_pages.html

Happy learning!!!


RE: Fresh install, CI_DEVELOPMENT in .env not work - okiewardoyo - 02-03-2024

(02-02-2024, 12:00 AM)luckmoshy Wrote: You are fine since you got that home Nothing is next, right? Please learn how to create an app with Codeigniter 4. Go here and start learning.


https://codeigniter.com/user_guide/tutorial/static_pages.html

Happy learning!!!

Hello, thank for reply, yes, i have learn it and now i'm on Environment. https://codeigniter.com/user_guide/general/environments.html
And until now i can not figure out why uncomment CI_ENVIRONMENT = development in .env file doesn't work.
Have you read my quenstion above? thanks.


RE: Fresh install, CI_DEVELOPMENT in .env not work - kenjis - 02-03-2024

It seems you did right things.

If you can use CLI, what will you see if you run the following command?
Code:
$ php spark env



RE: Fresh install, CI_DEVELOPMENT in .env not work - okiewardoyo - 02-03-2024

Hi all, i try to install fresh codeigniter from composer again
Code:
composer create-project codeigniter4/framework ci-news
again, i rename 'env' files to '.env', and change :
Code:
#CI_ENVIRONMENT = production
to
Code:
CI_ENVIRONMENT = development
then i do in terminal 
Code:
php spark serve
the result still in 'PRODUCTION ENVIRONMENT'.
Please anybody can reproduce it? Thanks


RE: Fresh install, CI_DEVELOPMENT in .env not work - kenjis - 02-03-2024

This is not the direct cause of your issue, but you should use appstarter:
Code:
composer create-project codeigniter4/appstarter ci-news
See https://www.codeigniter.com/user_guide/installation/installing_composer.html#installation

I don't know why your environment is still production.

Try this:
Code:
composer create-project codeigniter4/appstarter ci-news
cd ci-news/
php spark env development
php spark serve



RE: Fresh install, CI_DEVELOPMENT in .env not work - okiewardoyo - 02-03-2024

(02-03-2024, 06:33 PM)kenjis Wrote: This is not the direct cause of your issue, but you should use appstarter:
Code:
composer create-project codeigniter4/appstarter ci-news
See https://www.codeigniter.com/user_guide/installation/installing_composer.html#installation

I don't know why your environment is still production.

Try this:
Code:
composer create-project codeigniter4/appstarter ci-news
cd ci-news/
php spark env development
php spark serve

Hi, thanks so much @kenjis, using 
Code:
composer create-project codeigniter4/appstarter
not use
Code:
composer create-project codeigniter4/framework
fix my issues.