Hi! I downloaded the latest 4.0.1 self-hosted zip to evaluate I.N. for a client, and am getting this error:
PHP Fatal error: Uncaught Error: Class 'Crawler' not found in /opt/ninja/app/Exceptions/Handler.php:53
Stack trace:
#0 /opt/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(320): App\Exceptions\Handler->report(Object(Dotenv\Exception\InvalidFileException))
#1 /opt/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(123): Illuminate\Foundation\Console\Kernel->reportException(Object(Dotenv\Exception\InvalidFileException))
#2 /opt/ninja/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 {main}
thrown in /opt/ninja/app/Exceptions/Handler.php on line 53
This happens both via web and using any artisan command. I tried commenting out the Crawler references, but then get a similar message regarding class Utils. I’ve tried the various suggestions via the Troubleshooting section and others from the forums and github issues, but no luck. I tried using a zip from github as well, but same thing.
This is a brand new install on a Ubuntu 16.04 system, using php 7.0.26.
I commented out the Crawler refs, flipped the permissions and tried again:
gjh@restya:/opt/ninja$ php artisan optimize
PHP Fatal error: Uncaught Error: Class 'Utils' not found in /opt/ninja/app/Exceptions/Handler.php:72
Stack trace:
#0 /opt/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(320): App\Exceptions\Handler->report(Object(Dotenv\Exception\InvalidFileException))
#1 /opt/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(123): Illuminate\Foundation\Console\Kernel->reportException(Object(Dotenv\Exception\InvalidFileException))
#2 /opt/ninja/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 {main}
thrown in /opt/ninja/app/Exceptions/Handler.php on line 72
Then I deleted the bootstrap/cache files, but get the exact same error as above.
gjh@restya:/opt/ninja$ php artisan optimize
PHP Fatal error: Uncaught Dotenv\Exception\InvalidFileException: Dotenv values containing spaces must be surrounded by quotes. in /opt/ninja/vendor/vlucas/phpdotenv/src/Loader.php:228
Stack trace:
#0 /opt/ninja/vendor/vlucas/phpdotenv/src/Loader.php(97): Dotenv\Loader->sanitiseVariableValue('MAIL_FROM_NAME', 'FCC Invoice Nin...')
#1 /opt/ninja/vendor/vlucas/phpdotenv/src/Loader.php(330): Dotenv\Loader->normaliseEnvironmentVariable('MAIL_FROM_NAME', 'FCC Invoice Nin...')
#2 /opt/ninja/vendor/vlucas/phpdotenv/src/Loader.php(58): Dotenv\Loader->setEnvironmentVariable('MAIL_FROM_NAME=...')
#3 /opt/ninja/vendor/vlucas/phpdotenv/src/Dotenv.php(91): Dotenv\Loader->load()
#4 /opt/ninja/vendor/vlucas/phpdotenv/src/Dotenv.php(48): Dotenv\Dotenv->loadData()
#5 /opt/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/DetectEnvironment.php(24): Dotenv\Dotenv->load()
#6 /opt/ninja/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\DetectEnvironment->bootstrap(Object(Illum in /opt/ninja/vendor/vlucas/phpdotenv/src/Loader.php on line 228
I indeed did have an unescaped value in my .env file, so that error must not be getting trapped and thus breaking the app. Once I quoted the value (MAIL_FROM_NAME), the app loads and I can proceed with my evaluation.
Would you like me to file a bug report? I haven’t done anything in Laravel so not sure (how quickly) I could help with a PR.