PHP Fatal error: Uncaught ErrorException: Undefined variable #567

Closed
opened 2026-02-04 21:04:25 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @airstream on GitHub (Feb 3, 2018).

For Feature Requests

Desired Feature:

For Bug Reports

  • BookStack Version: v0.19.0
  • PHP Version: PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
  • MySQL Version: mysql Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using EditLine wrapper
Expected Behavior

I have an error after a bookstack. Apache's error_log is showing:
[Sat Feb 03 12:52:46.406239 2018] [:error] [pid 8796] [client 192.168.0.12:58331] PHP Fatal error: Uncaught ErrorException: Undefined variable: message in /var/www/bookstack/storage/framework/views/331c928a9bfd10f199fc390c413c0d7ed2387264.php:7\nStack trace:\n#0 /var/www/bookstack/storage/framework/views/331c928a9bfd10f199fc390c413c0d7ed2387264.php(7): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined varia...', '/var/www/bookst...', 7, Array)\n#1 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(43): include('/var/www/bookst...')\n#2 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(59): Illuminate\View\Engines\PhpEngine->evaluatePath('/var/www/bookst...', Array)\n#3 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(137): Illuminate\View\Engines\CompilerEngine->get('/var/www/bookst...', Array)\n#4 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(120): Illuminate\View\View->getContents()\n#5 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(85 in /var/www/bookstack/storage/framework/views/331c928a9bfd10f199fc390c413c0d7ed2387264.php on line 7, referer: http://192.168.0.20/

Please help.

Current Behavior
Steps to Reproduce
Originally created by @airstream on GitHub (Feb 3, 2018). ### For Feature Requests Desired Feature: ### For Bug Reports * BookStack Version: v0.19.0 * PHP Version: PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS ) * MySQL Version: mysql Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using EditLine wrapper ##### Expected Behavior I have an error after a bookstack. Apache's error_log is showing: [Sat Feb 03 12:52:46.406239 2018] [:error] [pid 8796] [client 192.168.0.12:58331] PHP Fatal error: Uncaught ErrorException: Undefined variable: message in /var/www/bookstack/storage/framework/views/331c928a9bfd10f199fc390c413c0d7ed2387264.php:7\nStack trace:\n#0 /var/www/bookstack/storage/framework/views/331c928a9bfd10f199fc390c413c0d7ed2387264.php(7): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Undefined varia...', '/var/www/bookst...', 7, Array)\n#1 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(43): include('/var/www/bookst...')\n#2 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(59): Illuminate\\View\\Engines\\PhpEngine->evaluatePath('/var/www/bookst...', Array)\n#3 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(137): Illuminate\\View\\Engines\\CompilerEngine->get('/var/www/bookst...', Array)\n#4 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(120): Illuminate\\View\\View->getContents()\n#5 /var/www/bookstack/vendor/laravel/framework/src/Illuminate/View/View.php(85 in /var/www/bookstack/storage/framework/views/331c928a9bfd10f199fc390c413c0d7ed2387264.php on line 7, referer: http://192.168.0.20/ Please help. ##### Current Behavior ##### Steps to Reproduce
OVERLORD added the 🐕 Support label 2026-02-04 21:04:25 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 3, 2018):

@airstream Can you provide some steps to re-produce the error at all? Is this after installation or when accessing a particular view?

Information about debugging errors can be found here, It may be useful to follow those steps to see if you can provide more information.

@ssddanbrown commented on GitHub (Feb 3, 2018): @airstream Can you provide some steps to re-produce the error at all? Is this after installation or when accessing a particular view? [Information about debugging errors can be found here](https://www.bookstackapp.com/docs/admin/debugging/), It may be useful to follow those steps to see if you can provide more information.
Author
Owner

@airstream commented on GitHub (Feb 3, 2018):

@ssddanbrown I have the next configuration: Ubuntu 1604 OS and I had installed bookstack by installation script https://www.bookstackapp.com/docs/admin/installation/#ubuntu-1604
And yes, after installation I see this error right now in web server error.log.

@airstream commented on GitHub (Feb 3, 2018): @ssddanbrown I have the next configuration: Ubuntu 1604 OS and I had installed bookstack by installation script https://www.bookstackapp.com/docs/admin/installation/#ubuntu-1604 And yes, after installation I see this error right now in web server error.log.
Author
Owner

@airstream commented on GitHub (Feb 3, 2018):

Debug mode is showing:

(1/1) InvalidArgumentException Unknown editor identifier: html. Known editors:sublime,textmate,emacs,macvim,phpstorm,idea,vscode

in PrettyPageHandler.php (line 415)
at PrettyPageHandler->setEditor('html')in Handler.php (line 375)
at Handler->Illuminate\Foundation\Exceptions{closure}(object(PrettyPageHandler))in helpers.php (line 1038)
at tap(object(PrettyPageHandler), object(Closure))in Handler.php (line 383)
at Handler->whoopsHandler()in Handler.php (line 333)
at Handler->Illuminate\Foundation\Exceptions{closure}(object(Run))in helpers.php (line 1038)
at tap(object(Run), object(Closure))in Handler.php (line 338)
at Handler->renderExceptionWithWhoops(object(QueryException))in Handler.php (line 313)
at Handler->convertExceptionToResponse(object(QueryException))in Handler.php (line 286)
at Handler->prepareResponse(object(Request), object(QueryException))in Handler.php (line 187)
at Handler->render(object(Request), object(QueryException))in Handler.php (line 63)
at Handler->render(object(Request), object(QueryException))in Pipeline.php (line 83)
at Pipeline->handleException(object(Request), object(QueryException))in Pipeline.php (line 55)
at Pipeline->Illuminate\Routing{closure}(object(Request))in SubstituteBindings.php (line 41)
at SubstituteBindings->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in VerifyCsrfToken.php (line 67)
at VerifyCsrfToken->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ShareErrorsFromSession.php (line 49)
at ShareErrorsFromSession->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in StartSession.php (line 63)
at StartSession->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in AddQueuedCookiesToResponse.php (line 37)
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in EncryptCookies.php (line 59)
at EncryptCookies->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Router.php (line 660)
at Router->runRouteWithinStack(object(Route), object(Request))in Router.php (line 635)
at Router->runRoute(object(Request), object(Route))in Router.php (line 601)
at Router->dispatchToRoute(object(Request))in Router.php (line 590)
at Router->dispatch(object(Request))in Kernel.php (line 176)
at Kernel->Illuminate\Foundation\Http{closure}(object(Request))in Pipeline.php (line 30)
at Pipeline->Illuminate\Routing{closure}(object(Request))in InjectDebugbar.php (line 65)
at InjectDebugbar->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TrustProxies.php (line 56)
at TrustProxies->handle(object(Request), object(Closure))in TrustProxies.php (line 45)
at TrustProxies->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in TransformsRequest.php (line 30)
at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in ValidatePostSize.php (line 27)
at ValidatePostSize->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in CheckForMaintenanceMode.php (line 46)
at CheckForMaintenanceMode->handle(object(Request), object(Closure))in Pipeline.php (line 149)
at Pipeline->Illuminate\Pipeline{closure}(object(Request))in Pipeline.php (line 53)
at Pipeline->Illuminate\Routing{closure}(object(Request))in Pipeline.php (line 102)
at Pipeline->then(object(Closure))in Kernel.php (line 151)
at Kernel->sendRequestThroughRouter(object(Request))in Kernel.php (line 116)
at Kernel->handle(object(Request))in index.php (line 53)

@airstream commented on GitHub (Feb 3, 2018): Debug mode is showing: (1/1) InvalidArgumentException Unknown editor identifier: html. Known editors:sublime,textmate,emacs,macvim,phpstorm,idea,vscode -- in PrettyPageHandler.php (line 415) at PrettyPageHandler->setEditor('html')in Handler.php (line 375) at Handler->Illuminate\Foundation\Exceptions\{closure}(object(PrettyPageHandler))in helpers.php (line 1038) at tap(object(PrettyPageHandler), object(Closure))in Handler.php (line 383) at Handler->whoopsHandler()in Handler.php (line 333) at Handler->Illuminate\Foundation\Exceptions\{closure}(object(Run))in helpers.php (line 1038) at tap(object(Run), object(Closure))in Handler.php (line 338) at Handler->renderExceptionWithWhoops(object(QueryException))in Handler.php (line 313) at Handler->convertExceptionToResponse(object(QueryException))in Handler.php (line 286) at Handler->prepareResponse(object(Request), object(QueryException))in Handler.php (line 187) at Handler->render(object(Request), object(QueryException))in Handler.php (line 63) at Handler->render(object(Request), object(QueryException))in Pipeline.php (line 83) at Pipeline->handleException(object(Request), object(QueryException))in Pipeline.php (line 55) at Pipeline->Illuminate\Routing\{closure}(object(Request))in SubstituteBindings.php (line 41) at SubstituteBindings->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in VerifyCsrfToken.php (line 67) at VerifyCsrfToken->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in ShareErrorsFromSession.php (line 49) at ShareErrorsFromSession->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in StartSession.php (line 63) at StartSession->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in AddQueuedCookiesToResponse.php (line 37) at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in EncryptCookies.php (line 59) at EncryptCookies->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in Pipeline.php (line 102) at Pipeline->then(object(Closure))in Router.php (line 660) at Router->runRouteWithinStack(object(Route), object(Request))in Router.php (line 635) at Router->runRoute(object(Request), object(Route))in Router.php (line 601) at Router->dispatchToRoute(object(Request))in Router.php (line 590) at Router->dispatch(object(Request))in Kernel.php (line 176) at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))in Pipeline.php (line 30) at Pipeline->Illuminate\Routing\{closure}(object(Request))in InjectDebugbar.php (line 65) at InjectDebugbar->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in TrustProxies.php (line 56) at TrustProxies->handle(object(Request), object(Closure))in TrustProxies.php (line 45) at TrustProxies->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in TransformsRequest.php (line 30) at TransformsRequest->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in ValidatePostSize.php (line 27) at ValidatePostSize->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in CheckForMaintenanceMode.php (line 46) at CheckForMaintenanceMode->handle(object(Request), object(Closure))in Pipeline.php (line 149) at Pipeline->Illuminate\Pipeline\{closure}(object(Request))in Pipeline.php (line 53) at Pipeline->Illuminate\Routing\{closure}(object(Request))in Pipeline.php (line 102) at Pipeline->then(object(Closure))in Kernel.php (line 151) at Kernel->sendRequestThroughRouter(object(Request))in Kernel.php (line 116) at Kernel->handle(object(Request))in index.php (line 53)
Author
Owner

@ssddanbrown commented on GitHub (Feb 3, 2018):

There's something strange here, The two logs above actually appear to be different errors. The error above is something going wrong with the error reporting code. Can't actually find where the above would be ran though.

Can you go to your BookStack install folder (cd /var/www/bookstack) and run php composer.phar install via the command line and report whether any errors show?

Did you notice any errors during the setup process?

@ssddanbrown commented on GitHub (Feb 3, 2018): There's something strange here, The two logs above actually appear to be different errors. The error above is something going wrong with the error reporting code. Can't actually find where the above would be ran though. Can you go to your BookStack install folder (`cd /var/www/bookstack`) and run `php composer.phar install` via the command line and report whether any errors show? Did you notice any errors during the setup process?
Author
Owner

@airstream commented on GitHub (Feb 3, 2018):

@ssddanbrown I resolved this problem by running next commands again:
cd /var/www/bookstack
wget https://composer.github.io/installer.sig -O - -q
curl -s https://getcomposer.org/installer > composer-setup.php
php -r "echo hash_file('SHA384', 'composer-setup.php'
php composer-setup.php
php composer.phar install
php artisan key:generate --no-interaction --force
php artisan migrate --no-interaction --force

I don't know why but mysql database did not contain any tables.
Please close this issue. Thank You @ssddanbrown for help!

@airstream commented on GitHub (Feb 3, 2018): @ssddanbrown I resolved this problem by running next commands again: cd /var/www/bookstack wget https://composer.github.io/installer.sig -O - -q curl -s https://getcomposer.org/installer > composer-setup.php php -r "echo hash_file('SHA384', 'composer-setup.php' php composer-setup.php php composer.phar install php artisan key:generate --no-interaction --force php artisan migrate --no-interaction --force I don't know why but mysql database did not contain any tables. Please close this issue. Thank You @ssddanbrown for help!
Author
Owner

@ssddanbrown commented on GitHub (Feb 3, 2018):

@airstream Happy to hear you got things working, Closing issue.

@ssddanbrown commented on GitHub (Feb 3, 2018): @airstream Happy to hear you got things working, Closing issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#567