Laravel error Frame.php line 123at HandleExceptions - php

Need help I am using framework Laravel 5.5 and everyday pretty often showing up this kind of error.
This error showing up usually on different pages l cannot understand what is wrong and whats is it could be maybe I should renew Laravel? Maybe it's going to solve a problem? I cleaned cache tried a lot of type of anything rules file storage/framework/views everything correct. Could anyone please help me who has the same problem or any type of situation?
Frame.php line 123at HandleExceptions->handleError(2, 'file_get_contents(/var/www/vhosts/*******/httpdocs/storage/framework/views/778d093ecf03c1c355a2d49e5e2d077704cd29d1.php): failed to open stream: No such file or directory', '/var/www/vhosts//*******//httpdocs/vendor/filp/whoops/src/Whoops/Exception/Frame.php', 123, array('filePath' => '/var/www/vhosts/r/*******//httpdocs/storage/framework/views/778d093ecf03c1c355a2d49e5e2d077704cd29d1.php'))at file_get_contents('/var/www/vhosts//*******//httpdocs/storage/framework/views/778d093ecf03c1c355a2d49e5e2d077704cd29d1.php')in Frame.php line 123at Frame->getFileContents()in Frame.php line 203at Frame->getFileLines(173, 40)in frame_code.html.php line 24at require('/var/www/vhosts/r/*******//httpdocs/vendor/filp/whoops/src/Whoops/Resources/views/frame_code.html.php')in TemplateHelper.php line 250at TemplateHelper->Whoops\Util\{closure}('/var/www/vhosts/r/*******//httpdocs/vendor/filp/whoops/src/Whoops/Handler/../Resources/views/frame_code.html.php ……

To me this looks like a view cache error. Try to run
php artisan view:clear
php artisan view:cache

The code does not have permission to create and edit files.
You need to go to the httpdocs directory and run the sudo chmod 777 -R storage/ command there

Related

Laravel swagger api-docs json file not found

Hello i am trying to add swagger into my laravel project.
installed
composer require "darkaonline/l5-swagger:5.6.*"
so when i do
http://127.0.0.1:8000/api/documentation
got info
Fetch error Not Found http://127.0.0.1:8000/docs/api-docs.json
already created docs folder with that json file.
Should i adjust route or change swagger base URL somewhere, not sure whats the problem. Tnx for your help.
You should run the command
php artisan l5-swagger:generate
after adding the annotations
And if you are still getting the Not Found http://your-host/docs/api-docs.json error.
Run chown www-data storage -R
if you still get "Not Found" error after running the
command : php artisan l5-swagger:generate
run
php artisan route:cache , worked for me
open in incognito in chrome or as a private tab in firefox
this problem for your internet explorer, chrome, FireFox

Symfony 3 deploying app via ftp error

I need to upload my symfony 3 project online, but I have only access to ftp. So I did all necessary steps I found:
composer update
Clear the cache for production: php app/console cache:clear --env=prod
Upload all app folder on server
After I open my website I got the following error:
Fatal error: require(): Failed opening required
'/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/zorbfutbal.sk/web/var..\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ApcClassLoader.php'
(include_path='.:/usr/php56/lib/php') in
/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/zorbfutbal.sk/web/var/bootstrap.php.cache on line 1780
I checked the file and I have it there and also set all permissions.
What is confusing me is that path from error before my actual domain name.
"/nfsmnt/hosting2_1/a/8/a87b3594-7cfe-459e-ad62-286d2dba2c54/"
I dont know where it comed from and how to fix it.
Any idea? Thanks
You are absolutely sure you set the file permissions correctly like indicated here:
http://symfony.com/doc/current/setup/file_permissions.html#using-acl-on-a-system-that-supports-setfacl-linux-bsd
The message you posted seems to point to something like that.
Also run:
php bin/symfony_requirements
just to check that you've met all the other requirements.

L5.2 PHP Fatal error: Declaration of Illuminate\Auth\SessionGuard::basic

I just pushed my L5.2 app to production server. I have made a few changes, but suddenly I get the following error:
PHP Fatal error: Declaration of Illuminate\Auth\SessionGuard::basic($field = 'email')
must be compatible with
Illuminate\Contracts\Auth\SupportsBasicAuth::basic($field = 'email', $extraConditions
= Array) in /home/forge/domain.com/bootstrap/cache/compiled.php on line 461
The app works fine locally and on the staging server.
just remove the bootstrap/cache/compiled.php file
rm bootstrap/cache/compiled.php
then run
composer dump-autoload
and
php artisan clear-compiled
it should work
I solved it.
I had to do:
rm bootstrap/compiled.php
I suppose that you have run composer update on production. You should copy composer.lock to production server (if you haven't done it yet) and run composer install to install exact same version you have on your localhost
You should also run php artisan clear-compiled because it might be also the problem.
Yes as other said, removing that file solves the error.
But in my case that file gets generated again and again automatically after 1 mins. (So to keep site running I need to manually delete that file over and over :) )
So here is what I did:
Opened that bootstrap/compiled.php, removed all the content and revoke write permission for that file.
And that worked very well for me.
I know its worst/temporary solution, but unless we know the exact cause of that issue and better solution, we can use this solution.
However I don't recommend anyone to use this solution for production sites, but you can use it for just a demo site like my case.

Empty services.json file is breaking site

I'm getting the
Whoops, looks like something went wrong.
on my production server.
All the sudden, no artisan commands are working. I was getting an error on /bootstrap/compiled.php:4496.
After removing compiled.php, I'm getting the same message
"array_merge(): Argument #2 is not an array" in /vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository".php:188.
My services.json files is empty, and when I try to PHP artisan cache:clear, I receive the same error message.
Does anyone know what I can try next? Thanks in advance
It looks like we ran out of space on the server. That's why it couldn't write to the file.
When Laravel is on production without debug option this message is shown "Whoops, looks like something went wrong.", you can edit you .env line
APP_DEBUG=false
to
APP_DEBUG=true
and then you will see error(have more info about error) you will know how to fix.
Removing services.json from bootstrap/cache fixed the issue.
Source: https://laracasts.com/discuss/channels/laravel/update-to-51-and-array-merge-argument-2-is-not-an-array
have you tried to delete your vender + /bootstrap/compiled.php and your service.json and then tried to reinstall laravel again using composer install ?

Laravel Migrations Deleted File

I'm working through Laracasts Laravel 5 Fundamentals however when coming to run a migration again I found that I had duplicate migrations at which point I figured - I should likely delete that. So I did... then began my issues.
When I attempt to load a migration now I get the following error:
[ErrorException]
include(/home/vagrant/Code/Laravel/database/migrations/2015_05_24_211527_create_articles_table.php): failed to
open stream: No such file or directory
However when I checked my database (Note that I have deleted and recreated it in order to combat my issue) and there are only two records in the mirgations table:
vagrant#homestead:~/Code/Laravel$ sqlite3 storage/database.sqlite
SQLite version 3.8.6 2014-08-15 11:46:33
Enter ".help" for usage hints.
sqlite> select * from migrations;
2014_10_12_000000_create_users_table|1
2014_10_12_100000_create_password_resets_table|1
sqlite>
Any help would be appreciated, if I'm being a moron and missing something obvious please feel free to point that out too.
Thanks!
The first error:
[ErrorException]
include(/home/vagrant/Code/Laravel/database/migrations/2015_05_24_211527_create_articles_table.php): failed to
open stream: No such file or directory
should be fixed executing composer dump-autoload.
About the second one: "However when I checked my database (Note that I have deleted and recreated it in order to combat my issue) and there are only two records in the mirgations table:"
As you said that you have recreated it, something went wrong because there is no migrations table, delete it and build it again
rm storage/database.sqlite
touch storage/database.sqlite
php artisan migrate:install
php artisan migrate
Please try, this one helped me to solve my problem
composer dump-autoload
Thanks

Categories