-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class Request does not exist in Illuminate/Container/Container.php #26229
Comments
Please post the whole stacktrace. |
I'd love to, but that is all i got. On every server (three of them), stack trace has been stripped for some reason. |
Are you using configuration caching ( |
Here is the full stack trace:
Yes i do use config caching, but i never had an issue, and i am using laravel in my project since 5.4. |
Just to rule it out: Run |
Unfortunately, that did not solve the issue. |
I notice it says Looks like a local error, where you have incorrectly named a class somewhere. It might work on your local machine (i.e. Windows) - but on production it might be case sensitive (i.e. Ubuntu). |
You mention that you see the error in "nginx/apache error log", do you have another error log with the full stacktrace? Like the one in the application's storage/logs folder? The request is added to the container very early in the lifecycle. You can found it in public/index.php in a call to Anyhow, check for a log file that contains all the nested exceptions too, you probably have some. Also, try editing |
All the development is done on Ubuntu, server runs on Ubuntu. I have also noticed that it is not But if there is an typo somewhere, shouldn't that cause problems with any version, not just the latest? Anyway, it was late yesterday to do extensive debugging, but now i can do it and see if its local, since nobody else reported it, and the error pops out as soon as i try to open the site, which means that it is triggered right on start. |
Closing the issue, problem was definitely local. Permissions on |
FWIW, I'm experiencing something similar, and getting the same error. For my particular case, the stack trace leads through this code in
Now, I'm not (yet) sure why this is breaking. For me, it's while running tests. I can make one HTTP request from my test and all is well, then second one triggers this same error, however. I'm not sure that this is worth re-opening...yet. I've spent a lot of time on this so far, but I've not made much headway. Also, I'm on PHPUnit 7.5.16 (although I just switched back from 8.x thinking it may have had something to do with PHPUnit) and Laravel Framework 6.0.3. |
Sorry...I also wanted to point out with the code above that the difference between Another interesting note...I've got around 125 tests across 6 test classes that work fine, making HTTP request after HTTP request. But, my 7th test class seems to have a problem. There are few differences in the test classes themselves. There's a lot of repetitive tests for the various API resources. The code for the resource with the failing tests does do some things differently....like dispatching jobs. I've still got to dig a bit more...and other than the error being the same and coming from a line of code that seems to work fine everywhere else, I'm not sure my particular problem is related...yet. |
make sure to use Laravel Controller and extend it this actulally the issue for me |
When I have this issue, I just |
Okay so I encountered the same issue here. I feel the pain. @staudenmeir 's Hope this helps someone out there, I nearly gave up tonight.. |
This was my problem, you saved my day. Thank you |
or try clearing bootstrap/cache dir. |
PHP Fatal error: Declaration of Illuminate\Foundation\Exceptions\Handler::repor can anyone help me with this error |
@Shailabk24 Did you recently upgrade to Laravel 7? Your error looks like they are documented in the upgrade notes. https://laravel.com/docs/7.x/upgrade#symfony-5-related-upgrades |
yeah my laravel version is 7.2.31 but my php artisan isn't working at all |
sir upgraded the latest version but now again there's an error |
(delete the php files in that directory/folder) It's hard to believe that this actually worked. :-o I had already run php artisan optimize, config:cache, config:clear .... And the error Illuminate\Contracts\Container\BindingResolutionException |
Because it's a bit of a chicken and egg problem. I commented this elsewhere, but forget where :} Those files are an intrinsic part for the "laravel boot" process and thus it happens already before any artisan command is executed. This means if an artisan command would exist to delete those files, and those cache files contain outdated information preventing Laravel from booting properly, you wouldn't get that far to actually delete them. |
I am still getting this problem in a docker container and nothing works to fix it. |
100% worked for me. it was upper case lower case issue in my case. Thanks a lot |
This is a code issue...In my app.php code i had used if (in_array(request(), ['X.X.X.X'])) Just search for request() in all of your code lines |
Had a similar issue and referencing the Controller directly solved it. |
Illuminate\Contracts\Container\BindingResolutionException Target class [view.engine.resolver] does not exist. at C:\Users\srall\Desktop\ecom\vendor\laravel\framework\src\Illuminate\Container\Container.php:811 1 [internal]:0 2 C:\Users\srall\Desktop\ecom\vendor\laravel\framework\src\Illuminate\Container\Container.php:809 |
A mi me funciono asi esa solución, o colocando directamente la ruta del controlador ejemplo: |
I had a similar error like this : All I had to do was to check the installed php versions using The result of that looks like this:
Since that error is a php 7 error, I had to disable php7.4 and enable php 8.0 by following the below steps:
Finally I had to restart apache2 for those changes to take effect using : |
Amazing |
I miss the days of vanilla PHP, where an error message would tell you exactly what the problem is. |
Description:
After an update from laravel/framework 5.7.9 to version 5.7.10, site won't open anymore with following error in nginx/apache error log (tested on both):
If i downgrade to 5.7.9 everything works fine. No code was changed between, only the framework was updated.
Steps To Reproduce:
Update laravel/framework to version 5.7.10.
The text was updated successfully, but these errors were encountered: