Apache returning 500 page after upgrading to 2022.11 #3380

Closed
opened 2026-02-05 06:33:10 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @RZR7332 on GitHub (Dec 2, 2022).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

After upgrading to 2022.11 earlier this morning, I can no longer access BookStack. Apache prints logs similar to the below:

Dec 02 11:16:31 Bookstack apache2[6771]: [proxy_fcgi:error] [pid 6771:tid 139780858365504] [client x.x.x.x] AH01071: Got error 'PHP message: PHP Warning: require(/var/www/bookstack/vendor/composer/../symfony/polyfill-php80/bootstrap.php): Failed to open stream: Permission denied in /var/www/bookstack/vendor/composer/autoload_real.php on line 55PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/var/www/bookstack/vendor/composer/../symfony/polyfill-php80/bootstrap.php' (include_path='.:/usr/share/php') in /var/www/bookstack/vendor/composer/autoload_real.php:55\nStack trace:\n#0 /var/www/bookstack/vendor/composer/autoload_real.php(38): composerRequire78dc58be6a5a48aa3ce6f7d6710337ec()\n#1 /var/www/bookstack/vendor/autoload.php(12): ComposerAutoloaderInit78dc58be6a5a48aa3ce6f7d6710337ec::getLoader()\n#2 /var/www/bookstack/public/index.php(34): require('...')\n#3 {main}\n thrown in /var/www/bookstack/vendor/composer/autoload_real.php on line 55'

While the services for Apache and PHP start successfully, I cannot access the web page as Apache returns a 500 page and prints the above. Line 55 in /var/www/bookstack/vendor/composer/autoload_real.php is as below:

require $file;

File is owned by www-data which I presume is expected.

Exact BookStack Version

2022.11

Log Content

Dec 02 11:16:31 Bookstack apache2[6771]: [proxy_fcgi:error] [pid 6771:tid 139780858365504] [client x.x.x.x] AH01071: Got error 'PHP message: PHP Warning: require(/var/www/bookstack/vendor/composer/../symfony/polyfill-php80/bootstrap.php): Failed to open stream: Permission denied in /var/www/bookstack/vendor/composer/autoload_real.php on line 55PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/var/www/bookstack/vendor/composer/../symfony/polyfill-php80/bootstrap.php' (include_path='.:/usr/share/php') in /var/www/bookstack/vendor/composer/autoload_real.php:55\nStack trace:\n#0 /var/www/bookstack/vendor/composer/autoload_real.php(38): composerRequire78dc58be6a5a48aa3ce6f7d6710337ec()\n#1 /var/www/bookstack/vendor/autoload.php(12): ComposerAutoloaderInit78dc58be6a5a48aa3ce6f7d6710337ec::getLoader()\n#2 /var/www/bookstack/public/index.php(34): require('...')\n#3 {main}\n thrown in /var/www/bookstack/vendor/composer/autoload_real.php on line 55'

This message repeats when trying to access the page.

PHP Version

8.1

Hosting Environment

Ubuntu 22.04 LTS LXC, installed using official script.

Originally created by @RZR7332 on GitHub (Dec 2, 2022). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario After upgrading to 2022.11 earlier this morning, I can no longer access BookStack. Apache prints logs similar to the below: Dec 02 11:16:31 Bookstack apache2[6771]: [proxy_fcgi:error] [pid 6771:tid 139780858365504] [client x.x.x.x] AH01071: Got error 'PHP message: PHP Warning: require(/var/www/bookstack/vendor/composer/../symfony/polyfill-php80/bootstrap.php): Failed to open stream: Permission denied in /var/www/bookstack/vendor/composer/autoload_real.php on line 55PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/var/www/bookstack/vendor/composer/../symfony/polyfill-php80/bootstrap.php' (include_path='.:/usr/share/php') in /var/www/bookstack/vendor/composer/autoload_real.php:55\nStack trace:\n#0 /var/www/bookstack/vendor/composer/autoload_real.php(38): composerRequire78dc58be6a5a48aa3ce6f7d6710337ec()\n#1 /var/www/bookstack/vendor/autoload.php(12): ComposerAutoloaderInit78dc58be6a5a48aa3ce6f7d6710337ec::getLoader()\n#2 /var/www/bookstack/public/index.php(34): require('...')\n#3 {main}\n thrown in /var/www/bookstack/vendor/composer/autoload_real.php on line 55' While the services for Apache and PHP start successfully, I cannot access the web page as Apache returns a 500 page and prints the above. Line 55 in /var/www/bookstack/vendor/composer/autoload_real.php is as below: require $file; File is owned by www-data which I presume is expected. ### Exact BookStack Version 2022.11 ### Log Content Dec 02 11:16:31 Bookstack apache2[6771]: [proxy_fcgi:error] [pid 6771:tid 139780858365504] [client x.x.x.x] AH01071: Got error 'PHP message: PHP Warning: require(/var/www/bookstack/vendor/composer/../symfony/polyfill-php80/bootstrap.php): Failed to open stream: Permission denied in /var/www/bookstack/vendor/composer/autoload_real.php on line 55PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/var/www/bookstack/vendor/composer/../symfony/polyfill-php80/bootstrap.php' (include_path='.:/usr/share/php') in /var/www/bookstack/vendor/composer/autoload_real.php:55\nStack trace:\n#0 /var/www/bookstack/vendor/composer/autoload_real.php(38): composerRequire78dc58be6a5a48aa3ce6f7d6710337ec()\n#1 /var/www/bookstack/vendor/autoload.php(12): ComposerAutoloaderInit78dc58be6a5a48aa3ce6f7d6710337ec::getLoader()\n#2 /var/www/bookstack/public/index.php(34): require('...')\n#3 {main}\n thrown in /var/www/bookstack/vendor/composer/autoload_real.php on line 55' This message repeats when trying to access the page. ### PHP Version 8.1 ### Hosting Environment Ubuntu 22.04 LTS LXC, installed using official script.
OVERLORD added the 🐕 Support label 2026-02-05 06:33:10 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 2, 2022):

Hi @RZR7332,
Looks like some funky permissions are at play.
Can you share the output of running the following:

ls -alh /var/www/bookstack/vendor/symfony/polyfill-php80
@ssddanbrown commented on GitHub (Dec 2, 2022): Hi @RZR7332, Looks like some funky permissions are at play. Can you share the output of running the following: ```bash ls -alh /var/www/bookstack/vendor/symfony/polyfill-php80 ```
Author
Owner

@RZR7332 commented on GitHub (Dec 2, 2022):

Hi Dan,

Inclined to agree, just not sure where it is coming from. As requested:

image

Not sure if root is correct in this case.

@RZR7332 commented on GitHub (Dec 2, 2022): Hi Dan, Inclined to agree, just not sure where it is coming from. As requested: ![image](https://user-images.githubusercontent.com/97453016/205298946-5677f9db-a0a8-4f75-b3a5-417dde410e97.png) Not sure if root is correct in this case.
Author
Owner

@ssddanbrown commented on GitHub (Dec 2, 2022):

@RZR7332 In your case, the web-server/PHP will be acting as www-data.
With those permissions, www-data has no access to those files.

A chown -R root:www-data /var/www/bookstack/vendor may fix things in this case, unless there are other permission issues at play.

If needed, I have a little guide on a permission approach, for all bookstack files, here: https://gist.github.com/ssddanbrown/f0e6e850e57c419c6541dbe6c8facd4b

@ssddanbrown commented on GitHub (Dec 2, 2022): @RZR7332 In your case, the web-server/PHP will be acting as `www-data`. With those permissions, `www-data` has no access to those files. A `chown -R root:www-data /var/www/bookstack/vendor` may fix things in this case, unless there are other permission issues at play. If needed, I have a little guide on a permission approach, for all bookstack files, here: https://gist.github.com/ssddanbrown/f0e6e850e57c419c6541dbe6c8facd4b
Author
Owner

@RZR7332 commented on GitHub (Dec 2, 2022):

@ssddanbrown I did think so, gave that a shot before replying - it changes the error message so do believe that was part of the problem.

Apache now returns:

[proxy_fcgi:error] [pid 9680:tid 140697292285504] [client x.x.x.x] AH01071: Got error 'PHP message: PHP Warning: require(/var/www/bookstack/app/Config/app.php): Failed to open stream: Permission denied in /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 72PHP message: PHP Fatal error: Uncaught RuntimeException: A facade root has not been set. in /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258\nStack trace:\n#0 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/RegisterErrorViewPaths.php(18): Illuminate\\Support\\Facades\\Facade::__callStatic()\n#1 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(598): Illuminate\\Foundation\\Exceptions\\RegisterErrorViewPaths->__invoke()\n#2 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(579): Illuminate\\Foundation\\Exceptions\\Handler->registerErrorViewPaths()\n#3 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(490): Illuminate\\Foundation\\Exceptions\\Handler->renderHttpException()\n#4 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(356): Illuminate\\Foundation\\Exceptions\\Handler->p...'

So to me, it still suggests a permissions issue... but I changed permissions for /var/www/bookstack/vendor and all nested folders - so www-data should have access now (if my understanding is right).

@RZR7332 commented on GitHub (Dec 2, 2022): @ssddanbrown I did think so, gave that a shot before replying - it changes the error message so do believe that was part of the problem. Apache now returns: [proxy_fcgi:error] [pid 9680:tid 140697292285504] [client x.x.x.x] AH01071: Got error \'PHP message: PHP Warning: require(/var/www/bookstack/app/Config/app.php): Failed to open stream: Permission denied in /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 72PHP message: PHP Fatal error: Uncaught RuntimeException: A facade root has not been set. in /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258\\nStack trace:\\n#0 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/RegisterErrorViewPaths.php(18): Illuminate\\\\Support\\\\Facades\\\\Facade::__callStatic()\\n#1 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(598): Illuminate\\\\Foundation\\\\Exceptions\\\\RegisterErrorViewPaths->__invoke()\\n#2 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(579): Illuminate\\\\Foundation\\\\Exceptions\\\\Handler->registerErrorViewPaths()\\n#3 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(490): Illuminate\\\\Foundation\\\\Exceptions\\\\Handler->renderHttpException()\\n#4 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(356): Illuminate\\\\Foundation\\\\Exceptions\\\\Handler->p...\' So to me, it still suggests a permissions issue... but I changed permissions for /var/www/bookstack/vendor and all nested folders - so www-data should have access now (if my understanding is right).
Author
Owner

@ssddanbrown commented on GitHub (Dec 2, 2022):

It's now having issues with /var/www/bookstack/app/Config/app.php, not a file in the vendor/ folder.
At this point, I'd probably look to my guide posted above to reset all permissions to a known state.

@ssddanbrown commented on GitHub (Dec 2, 2022): It's now having issues with `/var/www/bookstack/app/Config/app.php`, not a file in the `vendor/` folder. At this point, I'd probably look to my guide posted above to reset all permissions to a known state.
Author
Owner

@RZR7332 commented on GitHub (Dec 2, 2022):

Sigh. I don't know how this happened, but that has fixed it.

Thank you very much @ssddanbrown for the quick response and help, I really appreciate it.

Closing as resolved.

@RZR7332 commented on GitHub (Dec 2, 2022): Sigh. I don't know how this happened, but that has fixed it. Thank you very much @ssddanbrown for the quick response and help, I really appreciate it. Closing as resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3380