Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable set ENVIRONMENT with Spark #1268

Closed
uno-de-piera opened this issue Sep 28, 2018 · 4 comments
Closed

Unable set ENVIRONMENT with Spark #1268

uno-de-piera opened this issue Sep 28, 2018 · 4 comments

Comments

@uno-de-piera
Copy link

The documentation says that for change the environment we have some options:

Set CI_ENVIRONMENT=<environment> from .env file
Use SetEnv CI_ENVIRONMENT <environment> from .htaccess file on Apache

I tried all options but I'm unable to change the environment on my application.

The issue appears with spark server, if I serve my application with php -S localhost: -t=public all works fine.

@lonnieezell
Copy link
Member

Does not appear to be a bug. If I set it in .env file it works just fine. Tested by dd(ENVIRONMENT) within the spark file itself. Changes appeared as expected.

@cijagani
Copy link
Contributor

cijagani commented Apr 7, 2019

@uno-de-piera you are right. @lonnieezell i am facing same issue.
CI_ENVIRONMENT variable value is not changing
if i set CI_ENVIRONMENT=production in .env file then Debug Toolbar is still displayed and CI_ENVIRONMENT variable value is not changing.

because of $_SERVER['CI_ENVIRONMENT'] = 'development'; defined in rewrite. php
it is replacing CI_ENVIRONMENT variable value and if you remove above line in rewrite.php file then it will work.

file path : appstarter\vendor\codeigniter4\framework\system\Commands\Server\rewrite.php
Line : 20

CodeIgniter 4 version
4.0.0-beta.2
Context
OS : windows 8.1
webserver : apache2.4
php version : 7.2

it's working properly without SPARK means only issue appears with spark server

@cijagani
Copy link
Contributor

cijagani commented Apr 7, 2019

screenshot
https://pasteboard.co/I94mF2d.jpg

@lonnieezell lonnieezell reopened this Apr 9, 2019
@lonnieezell lonnieezell added this to the 4.0.0-beta.3 milestone Apr 9, 2019
@cijagani
Copy link
Contributor

@lonnieezell you can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants