You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/advanced-usage/env-support.md
+11-10
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
-->
9
9
# ENV File Support
10
10
11
-
Config files can also be configured using [PHP Environment variables ($_ENV)](https://www.php.net/manual/en/reserved.variables.environment.php). To utilize this, create a file named `.env.php` in the root of your ExpressionEngine install.
11
+
Config files can also be configured using [PHP Environment variables ($_ENV)](https://www.php.net/manual/en/reserved.variables.environment.php). To utilize this, create a file named `.env.php` in the root of your ExpressionEngine install.
12
12
13
13
NOTE: The `.env.php` file must be placed in same directory as the `system` directory. If you move the `system` directory above the webroot you must also move `.env.php`.
14
14
@@ -31,19 +31,20 @@ This variable can now be used in your `/system/user/config.php` as illustrated b
31
31
Here is an example of what it might look like to manage all your database connection settings, and Base URL in `.env.php`
32
32
33
33
```
34
-
// .env.php
35
-
36
-
// URLs
34
+
#.env.php
35
+
#URLs
37
36
BASE_URL=http://mysite.test/
38
37
39
-
// DATABASE SETTINGS
38
+
#DATABASE SETTINGS
40
39
DB_HOSTNAME=db
41
40
DB_DATABASE=db
42
41
DB_USERNAME=db
43
42
DB_PASSWORD=db
44
43
DB_PORT=3306
45
44
```
46
45
46
+
NOTE: You must use `#` for comments within `.env.php`. Using `//` will result in your `.env.php` being unable to be read.
47
+
47
48
```
48
49
// system/user/config.php
49
50
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
0 commit comments