.env file not loaded #4227

Closed
opened 2026-02-05 08:17:33 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @perfectfe on GitHub (Sep 21, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I am completely confused. We have been using Bookstack for a few months. I have edited the .env file several times in the past, it has never been a problem.

Now I wanted to edit the file again to adjust the sendmail parameters. But no matter what I do, the new configuration is not applied. Even deleting .env does not change anything, Bookstack still works. Even after reboot of Apache or the whole server, Bookstack is running file without having the .env file in place.

How can it be that Bookstack can be started successfully without .env file? Or where can the configuration be stored alternatively?

Exact BookStack Version

23.06.2

Log Content

No response

Hosting Environment

The Bookstack installation is done in the default path /var/www/bookstack, it is BookStack v23.06.2 on Ubuntu 20.04.

Originally created by @perfectfe on GitHub (Sep 21, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I am completely confused. We have been using Bookstack for a few months. I have edited the .env file several times in the past, it has never been a problem. Now I wanted to edit the file again to adjust the sendmail parameters. But no matter what I do, the new configuration is not applied. Even deleting .env does not change anything, Bookstack still works. Even after reboot of Apache or the whole server, Bookstack is running file without having the .env file in place. How can it be that Bookstack can be started successfully without .env file? Or where can the configuration be stored alternatively? ### Exact BookStack Version 23.06.2 ### Log Content _No response_ ### Hosting Environment The Bookstack installation is done in the default path /var/www/bookstack, it is BookStack v23.06.2 on Ubuntu 20.04.
OVERLORD added the 🐕 Support label 2026-02-05 08:17:33 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Sep 21, 2023):

Hi @perfectfe,
Can you provide the output of running ls -alh /var/www/bookstack/bootstrap/cache?

@ssddanbrown commented on GitHub (Sep 21, 2023): Hi @perfectfe, Can you provide the output of running `ls -alh /var/www/bookstack/bootstrap/cache`?
Author
Owner

@perfectfe commented on GitHub (Sep 22, 2023):

Hi @ssddanbrown

thanks for you quick response!

Here is the output:

ls -alh /var/www/bookstack/bootstrap/cache
total 68K
drwxrwxr-x 2 username www-data  4.0K Aug  9 13:27 .
drwxr-xr-x 3 username www-data  4.0K Jul 19 09:55 ..
-rwxrwxr-x 1 username www-data    14 May 17 16:35 .gitignore
-rw-r--r-- 1 root      root      30K Aug  9 13:27 config.php
-rwxrwxr-x 1 username username  1.6K Jul 19 09:55 packages.php
-rwxrwxr-x 1 username username   20K Jul 19 09:55 services.php
@perfectfe commented on GitHub (Sep 22, 2023): Hi @ssddanbrown thanks for you quick response! Here is the output: ``` ls -alh /var/www/bookstack/bootstrap/cache total 68K drwxrwxr-x 2 username www-data 4.0K Aug 9 13:27 . drwxr-xr-x 3 username www-data 4.0K Jul 19 09:55 .. -rwxrwxr-x 1 username www-data 14 May 17 16:35 .gitignore -rw-r--r-- 1 root root 30K Aug 9 13:27 config.php -rwxrwxr-x 1 username username 1.6K Jul 19 09:55 packages.php -rwxrwxr-x 1 username username 20K Jul 19 09:55 services.php ```
Author
Owner

@SirTwinkleberry commented on GitHub (Sep 24, 2023):

None of my instances have a config.php file in there. Could it be the file creating an issue?

@SirTwinkleberry commented on GitHub (Sep 24, 2023): None of my instances have a `config.php` file in there. Could it be the file creating an issue?
Author
Owner

@ssddanbrown commented on GitHub (Sep 24, 2023):

Sorry, forgot to respond back to this, Yeah, please remove the /var/www/bookstack/bootstrap/cache/config.php file, and everything should work as expected. The config gets cached to this file when certain optimization commands are ran, and therefore .env changes won't be taken into account as experienced.

@ssddanbrown commented on GitHub (Sep 24, 2023): Sorry, forgot to respond back to this, Yeah, please remove the `/var/www/bookstack/bootstrap/cache/config.php` file, and everything should work as expected. The config gets cached to this file when certain optimization commands are ran, and therefore `.env` changes won't be taken into account as experienced.
Author
Owner

@perfectfe commented on GitHub (Sep 24, 2023):

This solves the mystery of the ignored .env file.

Unfortunately, it only helps to a limited extent. When I delete the config.php file, Bookstack does not start anymore. When I call it up in the browser, I only get a white page.

@perfectfe commented on GitHub (Sep 24, 2023): This solves the mystery of the ignored .env file. Unfortunately, it only helps to a limited extent. When I delete the config.php file, Bookstack does not start anymore. When I call it up in the browser, I only get a white page.
Author
Owner

@ssddanbrown commented on GitHub (Sep 24, 2023):

@perfectfe A blank white screen usually indicates a permissions issue. To verify, the error should be logged to the webserver log (Commonly /var/log/apache2/error.log in this case).

I have extra guidance on file-system permissions here if needed.

@ssddanbrown commented on GitHub (Sep 24, 2023): @perfectfe A blank white screen usually indicates a permissions issue. To verify, the error should be logged to the webserver log (Commonly `/var/log/apache2/error.log` in this case). I have [extra guidance on file-system permissions here](https://www.bookstackapp.com/docs/admin/filesystem-permissions/) if needed.
Author
Owner

@perfectfe commented on GitHub (Sep 24, 2023):

resetting the permissions helped, Boostack now runs as expected again.

a big thank you to both of you for the quick and competent help! i really appreciate it.

@perfectfe commented on GitHub (Sep 24, 2023): resetting the permissions helped, Boostack now runs as expected again. a big thank you to both of you for the quick and competent help! i really appreciate it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4227