Some PHP errors don't appear in the browser - php

I'm working in a Laravel 5 application. I have been playing around with the configuration values and creating routes, controllers, models and views. I used to view all PHP errors in the browser, but now, I don't understand why. I just get some errors. In some case, the browser just returns the 500 http error (Internal server error).
For example, if I call a url that don't have a correspondent route, I get an error description in the browser. If I have a route pointing to a controller that does not exist, I only receive the 500 http error. Why does this happen?

It was a permissions problem, specifically on the storage folder, i.e. Laravel cannot write to the log file. Just running chmod -R 755 storage from the root of the project and the problem was resolve.

Related

No controllers folder in Laravel project

I have downloaded a project from some website. When i run php artisan server it runs successfully shows server has started on 127.0.0.1:8000. When hit localhost:8000 in browser it gives http 500 error. So i checked the storage/logs/laravel.log file its blank, the logs are not going there. I don't know why. Apart from this there is not http folder inside app folder which contains controllers. So I go through the routes/web.php to see which controllers are being used so i found 'RegisterController', 'LoginController' written in routes file. So i searched for these controllers in whole project I found 'RegisterController.stub' inside 'vendor/hesto/multi-auth/src/stubs/Controllers'. I don't know how to run this project. I have attached the screenshot of app directory.

GraphQL - Warning: rename .....access denied

my local GraphQL backend throws Internal server errors, when I try to fetch stuff from the DB. The live environment which is identical runs without those errors. In the chrome DevTools under Network GraphQL outputs following debug message when I try to fetch the data from the frontend (ionic):
debugMessage: "Warning: rename(D:\pathToLocalBackendFolder\var\cache\dev/doctrine/orm/Proxies__CG__AppEntityProperty.php.6058d378460452.39776425,D:\pathToLocalBackendFolder\var\cache\dev/doctrine/orm/Proxies__CG__AppEntityProperty.php): Zugriff verweigert (code: 5)"
"Zugriff verweigert" translates to "Access denied"
The backend is Symfony 5.1. And I run a local apache server with Wampserver64 under Windows10 Pro.
The apache hosts my backend with SSL (wasn't easy to setup) but the problem persists also when I create a virtualhost without SSL.
It does seem to fetch all the data anyways but I would like to fix those error messages anyways, because later on it could stab me in the back.
What I tried so far to resolve it:
Write umask(0000); in the beginning of bin/console and public/index.php
Run the wampapache64 and wampmysqld64 services as a local admin user (tested the renaming functionality of the specific files by logging in as that user. So the user I let the services run from has all the necessary permissions. Also I double checked by echoing 'whoami' from within GraphQL. It was the correct user I specified before.)
Gave the var/cache folder and all subfolder and all subfiles full permission (via chmod command and also via Windows folder properties)
Cleared the cache (var/cache) of symfony a couple of times. Sometimes with php bin/console cache:clear or even by deleting tha content manually
I did try everything I could from that link: https://symfony.com/doc/current/setup/file_permissions.html
And I also checked out this link and try to apply it: https://symfony.com/doc/current/setup/web_server_configuration.html
What can I try next?

Laravel URL rewrite Error

Actually I am deploying my laravel 5 Application on Client Server.
My client create space for me in such type of path.
var/www/html/abcproject
Now I have uploaded my all laravel 5 file on abcproject directory.
My issue is that , my home page is working fine but my internal pages
are giving Not Found Error.
Suppose when I try to logged in, throwing this error.
Not Found
The requested URL /abcproject/login was not found on this server.
How to resolve that error?
You need to point the webroot to var/www/html/abcproject/public

Laravel 5.2 - Staging to Live Server : 500 Internal Server Error

I have a Laravel 5.2 project working fine locally, after uploading to a live server I have a 'laravel' folder in my root directory and public folder under 'public_html/testsite'
My 'index.php' points to the correct '/bootstrap/autoload.php' and '/bootstrap/app.php'
Upon going to my 'url/testsite/' I get a blank page only (was working fine L5.0) firebug shows : 500 Internal Server Error with HTML : Reload the page to get source for...
index.php is loading by testing with die() before any 'require' methods, but after 'require... autoload.php' the die() is not working, however it is successfully calling autoload.php as a die() works within this file.
I'm not sure if this is a .htaccess issue, or maybe I had to set something up in cPanel last time for this folder (I can't remember). I'd appreciate any help!
Please note this Laravel project sits as a test site in a /testsite/ folder along with my current live site files.
Amongst changing many things at once, I appeared to have solved this by setting up a subdomain within cPanel and setting this to my testsite/ folder.
This was on a server with my current website live under public_html/ and setting up a test laravel app(website) with under public_html/testsite/ to work as an independent site for testing.
The typical "change permissions on storage folder" suggested elsewhere on stackoverflow did not solve my issue so hopefully this helps someone in the same boat.

Why do I not have any laravel error pages on my server?

I'm using Laravel 5.0. So when I was messing around with laravel on Vagrant it was really easy to debug because of the laravel error pages. Now that I've installed again on an actual apache server, I get no error pages.
I have forced a error by typing a variable that wasn't there and all I get is a WSOD with chrome telling me its a 500 error. I take that variable away and everything works fine, so I know whats causing my 500 error.
Edit: I have already changed 'debug' to true in my config/app file.
Any idea on how to get these error pages back?
When installing laravel on a server you must ensure that you set the correct permissions to the storage directory
sudo chmod o+w storage

Categories