Laravel 7.3 route shows blank page without error - php

This route was working for months but suddenly it went blank and I got no errors and logs for it. I tried cleaning the cache using "php artisan optimize:clear" and cleared all the possible caches, but it doesn't work!
I haven't had any changes related to this route and view. It seems like a bug. My Laravel version is 7.30.4.
And I'm sure it's a route-related issue because changes in view don't affect it.

Yo should put some debug or code on the Handler.php, just to be sure if there's an Exception. Also change your .env enviorment to not production, don't forget to run a "php artisan optimize". Hope this info helps you.

Related

Problem with Symfony 5 in prod but not dev

I have a problem with my project in symfony 5.4 (recently update from 4.4)
I deploy my project on the prod server (on a subdomain) and he don't work in prod environnement, but work in dev.
I already :
_ fix permissions for /var folder
_ set up vhosts (i'm on plesk so i put directives in vhost.conf, in my subdomain)
_ install and update composer
The problem is that there is a lot of missing image (it's ok they are on prod), when i run the project in dev, missing image return a 404 error, but when i turn symfony on prod, missing image return a 500 error, and then the all site is on error 500 untill i clear symfony cache.
I have the previous verison (the 4.4 one), who run in the principal domain, and i dont have this problem.
I deploy the exact same project (the new one in 5.4), in an others test server, and he works in dev and prod (no error 500 on image).
I think it's a server problem, but i passed 4 days on this, i tried a lot of thing, and i'm still stuck :)
First, thank you for trying to help me, i appreciate that.
So.
For removing the error with the image (error 500 instead 404), it appears that the problem was coming from my error templates 'bundles/TwigBundles/error.html.twig', i removed all the code and try just a simple tag, clear the cache and then the missing images trhow a 404 error.
I also reinstall composer require symfony/twig-pack
This helped me : https://stackoverflow.com/a/13741553/20040268
So the site was running fast this time, but as soon i changed page, error 500 again...at least it was fast ^^
So i keep digging, and like #user1915746 said, i started searching with php and the error code i send : mod_fcgid: error reading data from FastCGI server.
I tried a lot of thing for removing this error like :
https://stackoverflow.com/a/12192622/20040268
But still not resolved my problem.
Finally i decided to change the all php ^^ I was in 7.4.30, i pass in php 8.0.20 and...voila...no more error 500...
If you guys have the same thing, and tried all i tried, change php version or if you can't try to see if you don't have missing package (like php-cgi).
Thank you again for your time!

Why is the information on Laravel's error screen hidden?

I took over a Laravel 5.5 project, and there is something going on that I have never encountered - the content on the error reporting screen is all replaced by stars.
I don't know what the previous devs did to accomplish this, but obviously I want to be able to see this info. The .env content seems fairly obvious:
APP_ENV=local
APP_HOST=http://localhost
APP_DEBUG=true
APP_TESTMODE=false
APP_CACHE_ENABLED=true
Other than that, there are API keys for Stripe, AWS etc, but nothing that would presume to block me from viewing the info on the error screen.
Why is this problem occurring and how can I fix it?
You probably have the debug_blacklist set, as seen in the documentation
Simply remove the debug_blacklist array from your config/app.php configuration file and the values will reveal.

Laravel 5.4 - cannot set debug environment

I am taking the "Laravel 5.4 From Scratch' course on Laracasts. I created two projects and everything was working well, but I realized that the server stopped showing me debug errors. It now throws the generic 'Sorry, page could not be found' error in BOTH applications (completely separate from each other), I run them with php artisan serve.
Laravel is ignoring the APP_DEBUG=true and APP_ENV=local in .env file.
In config/app.php:
'env' => env('APP_ENV', 'local');
'debug' => env('APP_DEBUG', true);
The application doesn't show debug, just some regular simple 'this page can not be found' errors.
I've tried:
rebooting the server
php artisan config:clear
php artisan optimize
php artisan cache:clear
nothing works, the environment is still production-like, doesn't display any errors.
How to turn on debugging?
UPDATE: php artisan env returns local but on the browser-side nothing changes, still generic user-friendly error pages. I tried on different browsers and clearing browser cache, nothing works.
The error you mention is a 404, not an error when the app fails, so the error has not much to say.
Try writting some breaking code to see the detailed debugging error
If both apps started to show that error in well-known routes you had working before, maybe you modified something that breaked all the routes and you cannot match any of them.

Bare error 500 in Laravel - tried everything

In a Vagrant Homestead environment (in Windows via VMware) I get the bare error 500 with some errors (e.g., forgotten "use") but normal Laravel debug error page with others (e.g., failing to define a route properly or failing to pass a variable to a blade template).
I have tried every solution I've found here and in searching, specifically:
Reset permissions of storage dir (changed inside the VM and in Windows via git bash)
Reset permissions of bootstrap/cache dir (changed inside the VM and in Windows via git bash)
Cleared various cache directories
Checked Laravel log (nothing in it about the failed event at all - which seems very odd)
Checked nginx log (nothing in it about the failed event at all - which seems very odd)
Checked FPM log (nothing in it about the failed event at all)
Tried inserting my own exception code, per some people's posts, it never is executed/shown
Tried inserting old error_reporting(E_ALL); ini_set("display_errors", 1); include("file_with_errors.php"); in a few different places per other posts -- nothing.
Tried resetting the encryption key since someone said that might be an issue (why I don't know) -- nothing
Tried reverting back to a backup of a week ago to undo symphony/etc. upgrades -- nothing
Tried composer update -- nothing
Tried php artisan optimize -- nothing
My APP_DEBUG setting is right (and again working appropriately on many errors just not certain ones, like missing "use")
My project has ground to a halt because I can't debug even basic issues, and I'm out of ideas for what to try.
Any help greatly appreciated. I am stuck until I resolve this.

Laravel 5.1 Mail::send .env configuration doesn't work

I have a queued job that is supposed to send emails. I keep getting an error:
Swift_TransportException(code: 530): Expected response code 250 but
got code \"530\", with message \"530 5.7.1 Authentication
required\r\n\" at
/my/project/path/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:383
I tried using mail, sendmail and smtp drivers. However if I set config values directly via mail.php in config dir it seems to work fine.
Once I get back to .env configuration it's the same problem again.
I tried outputting .env and config values in my templates - they all seem fine.
Any ideas what might be causing this?
The problem was in queue:listener.
Spend a lot of time trying to figure out why my config is being replaced with a wrong one.
Finally killing the php artisan queue:listen process and letting supervisor restart it solved everything.
Still not sure what was causing that. Maybe the .env was cached or something. Restarting the process did the trick.
It occurs just because your changes are not detected by artisan so it requires restarting artisan. There is nothing to do with php artisan queue:listen

Categories