This question already has answers here:
How to set up file permissions for Laravel?
(21 answers)
Closed 2 years ago.
Hi there i have an error on laravel but i don't know where is, this error make me website on error 404 , with another error HTTP 500
[26-Feb-2019 18:10:48 UTC] PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected 'endif' (T_ENDIF), expecting end of file in /home2/website/website.com/storage/framework/views/6a75bc263740fca85e4609e4affe4f57142c2c3a.php:181
Stack trace:
#0 /home2/website/website.com/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(59): Illuminate\View\Engines\PhpEngine->evaluatePath('/home2/website...', Array)
#1 /home2/website/website.com/vendor/laravel/framework/src/Illuminate/View/View.php(142): Illuminate\View\Engines\CompilerEngine->get('/home2/website...', Array)
#2 /home2/website/website.com/vendor/laravel/framework/src/Illuminate/View/View.php(125): Illuminate\View\View->getContents()
#3 /home2/website/website.com/vendor/laravel/framework/src/Illuminate/View/View.php(90): Illuminate\View\View->renderContents()
#4 /home2/website/website.com/storage/framework/views/e5516c2faf25e2e2a432f5486f5485d6792013e9.php(53): Illuminate\View\View->render()
#5 /home2/website/website.com/vendo in /home2/website/website.com/storage/framework/views/6a75bc263740fca85e4609e4affe4f57142c2c3a.php on line 181
[26-Feb-2019 18:10:48 UTC] PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected 'endif' (T_ENDIF), expecting end of file in /home2/website/website.com/storage/framework/views/6a75bc263740fca85e4609e4affe4f57142c2c3a.php:181
Stack trace:
#0 /home2/website/website.com/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(59): Illuminate\View\Engines\PhpEngine->evaluatePath('/home2/website...', Array)
#1 /home2/website/website.com/vendor/laravel/framework/src/Illuminate/View/View.php(142): Illuminate\View\Engines\CompilerEngine->get('/home2/website...', Array)
#2 /home2/website/website.com/vendor/laravel/framework/src/Illuminate/View/View.php(125): Illuminate\View\View->getContents()
#3 /home2/website/website.com/vendor/laravel/framework/src/Illuminate/View/View.php(90): Illuminate\View\View->renderContents()
#4 /home2/website/website.com/storage/framework/views/e5516c2faf25e2e2a432f5486f5485d6792013e9.php(53): Illuminate\View\View->render()
#5 /home2/website/website.com/vendo in /home2/website/website.com/storage/framework/views/6a75bc263740fca85e4609e4affe4f57142c2c3a.php on line 181
Just read the error that's beside the date posted.
HP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected 'endif' (T_ENDIF), expecting end of file in /home2/website/website.com/storage/framework/views/6a75bc263740fca85e4609e4affe4f57142c2c3a.php:181
So in one of the views that's generated, there is an unexpected endif on line 181.
This file: 6a75bc263740fca85e4609e4affe4f57142c2c3a.php is the one that's generated, you'll have to look into this file in the storage/framework/views/ folder. From there, you can figure out the actual view (in your resources folder) that it's created from. The real problem will be there.
Just read the first line of the error log [26-Feb-2019 18:10:48 UTC] PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected 'endif' (T_ENDIF), expecting end of file in /home2/website/website.com/storage/framework/views/6a75bc263740fca85e4609e4affe4f57142c2c3a.php:181
.
Seems that you forgot to put an #endif directive on the view you're trying to access.
For more, read here: Control Structures
Add Bugsnag to your application to automatically detect handled and unhandled Laravel errors.
Bugsnag integration Laravel guide
Related
I'm trying to use Toastr package in my application to have alerts displayed to the user. I followed the tutorial here but now I can't have access to my app; I'm having this error :
Fatal error: Uncaught RuntimeException: A facade root has not been set. in C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:234 Stack trace: #0 C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(397): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array) #1 C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(374): Illuminate\Foundation\Exceptions\Handler->registerErrorViewPaths() #2 C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(289): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException)) #3 C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(188): Illuminate\Foundation\Exceptions\Handler->prepareResponse(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpKernel\Exception\HttpExcepti in C:\xampp\htdocs\MonProjet\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 234
Any thoughts on this issue? I've followed the steps and I'm getting this error. What is wrong there.. ?
Your question is not clear. please details,
and you can add your blade # before render. example:-
#toastr()->render();
I know whenever someone types wrong artisan command a well-formatted error message is shown
But there is some problem in my project because when I run wrong command eg
php artisan create:migration create_table
I am getting this output
PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "/home/amarjit/Documents/localhost/inkpothub/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107
Stack trace:
#0 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\StreamHandler->write(Array)
#1 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Logger.php(337): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#2 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Logger.php(616): Monolog\Logger->addRecord(400, Object(UnexpectedValueException), Array)
#3 /home/amarjit/Documents/localhost/inkpothub/vendor/laravel/framework/src/Illuminate/Log/Writer.php(202): Monolog\Logger->error(Object(UnexpectedValueException), Array)
#4 /home/amarjit/Documents/localhost/inkpothu in /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "/home/amarjit/Documents/localhost/inkpothub/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107
Stack trace:
#0 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\StreamHandler->write(Array)
#1 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Logger.php(337): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#2 /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Logger.php(616): Monolog\Logger->addRecord(400, Object(Symfony\Component\Debug\Exception\FatalErrorException), Array)
#3 /home/amarjit/Documents/localhost/inkpothub/vendor/laravel/framework/src/Illuminate/Log/Writer.php(202): Monolog\Logger->error(Object(Symfony\Component\Debug\Exception\FatalErrorExcept in /home/amarjit/Documents/localhost/inkpothub/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107
its only happening with one of my Laravel-5.3 project. Therefore the issue is not related with my localhost
I got this error when trying to run my php artisan migrate on my production server...
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
I ran env on the command line and I have an env variable called BUGSNAG_API_KEY and the value of it exactly matches the key at bugsnag.com for this project.
Furthermore, I have this line in my project at ./config/bugsnag.php
'api_key' => env('BUGSNAG_API_KEY'),
Weirdly, I eventually tried the same command again (php artisan migrate) and it worked! But it's left me very unsettled as it's a production server. So I'd like to understand the problem.
Errors seem to be logging in Bugsnag as well by the way.
Try to regenerate the configuration cache with php artisan config:cache. It will use the current data from the .env file to generate a new configuration cache. This worked for me.
In case this helps anyone...
The Bugsnag Git Repo mentions this issue:
(Uncaught exception 'ReflectionException' with message 'Class bugsnag.logger does not exist'
Github user GrahamCampbell suggested that what is actually happening is that another error exists, but it's "...trying to log to bugsnag which is causing this error, which is hiding the real error". I confirmed this was my issue by doing what user russianryebread suggested, which was to manually copy the bugsnag.php config file over to the Laravel /config directory. Once I did that now my real error shows:
[Symfony\Component\Debug\Exception\FatalThrowableError] Parse error: syntax error, unexpected '{'
Now to troubleshoot this issue :)
Hope this helps!
Hi I have installed PHPBB3 and I tried to disapprove a post and i am getting following error
Fatal error: Uncaught exception
'Symfony\Component\DependencyInjection\Exception\InvalidArgumentException'
with message 'The service definition
"phpbb.report.report_reason_list_provider" does not exist.' in
/var/www/html/ddugky/forum/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php:871
Stack trace: 0
/var/www/html/ddugky/forum/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php(478):
Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition('phpbb.report.re...')
1 /var/www/html/ddugky/forum/includes/mcp/mcp_queue.php(1245): Symfony\Component\DependencyInjection\ContainerBuilder->get('phpbb.report.re...')
2 /var/www/html/ddugky/forum/includes/mcp/mcp_queue.php(122): mcp_queue::disapprove_posts(Array, 'queue', 'unapproved_post...') #3
/var/www/html/ddugky/forum/includes/functions_module.php(674):
mcp_queue->main('queue', 'unapproved_post...') #4
/var/www/html/ddugky/forum/mcp.php(311): p_master->load_active() #5
{main} in
/var/www/html/ddugky/forum/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
on line 871
I found out reason because phpbb did not contain reports folder and now i created report folder and its contents yet again same error is displayed
Can anyone please help
I've migrated a Joomla site to a new server, updated the configuration.php file, and I'm getting these errors:
Fatal error: Uncaught exception 'RuntimeException' with message 'Less Parse Error: parse error: unclosed block' in
/var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php:1141 Stack trace: #0
/var/www/websites/alwaysevolving/templates/rt_cerulean/features/styledeclaration.php(45): Gantry->addLess('mediaqueries.le...') #1
/var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php(415): GantryFeatureStyleDeclaration->init() #2
/var/www/websites/alwaysevolving/libraries/gantry/gantry.php(289): Gantry->initTemplate() #3
/var/www/websites/alwaysevolving/libraries/gantry/gantry.php(439): gantry_template_initialize() #4
/var/www/websites/alwaysevolving/templates/rt_cerulean/lib/gantry/gantry.php(21): include('/var/www/websit...') #5
/var/www/websites/alwaysevolving/templates/rt_cerulean/index.php(15): require_once('/var/www/websit...') #6
/var/www/websites/alwaysevolving/libraries/joomla/document/html/html.php(531): require('/var/www/websit...') #7
/var/www/websites/alwaysevolving/libraries/joomla/do in /var/www/websites/alwaysevolving/libraries/gantry/core/gantry.class.php on line 1141
It looks like there's a problem parsing one of the less files, but:
I can't tell which one of the less files has the issue
The less files were fine on the other server
The site seems fine, so it seems like something in this template doesn't like my new server.
Thoughts??
Thanks!
The error message is a stack trace, but looking at it, it appears that the Gantry framework parsing the less file called mediaqueries.less.
I strongly believe that you have forgetten to close braces }. make sure to check the line number will help you resolve the issue.