Laravel 5.1 manualy clearing views cache, caused error 500 - laravel

I just removed all files inside laravelApp/storage/framework/views and all of routes now return error 500.
Command php artisan views:clear and php artisan cache:clear tested, but had no affect.
Error reporting is set to E_All, APP_DEBUG is true both in app.php and .env file, But i see only a simple error 500 (generated by browser).
How can i fix it?

i set permission for my folder that cointain all files
sudo chown -R www-data:www-data /var/www/myweb
(ubuntu)
and it is ok!

Related

APP_URL not refreshing after a change

I'm building a Laravel 9 app using Docker.
I'm just starting, so I merely updated the APP_URL variable in the .env (from "http://localhost" to "http://mydomain.local").
After this, I ran the following commands:
php artisan cache:clear
php artisan config:clear
php artisan route:clear
composer dump-autoload
and I restarted the Docker container of the app.
Yet, when I access http://mydomain.local in my browser, the app doesn't load. It still loads properly when I user http://localhost as originally configured.
What am I missing?
This is because you probably didnt edit the vhost..
Just changing the APP_URL in the .env file doesnt change how the browser resolves a domain name.
See this thread to learn how to edit a vhost file: WAMP Server virtual hosts configuration

Laravel 5.4 Token Mismatch Exception on live server

I am facing Token mismatch exception in Laravel 5.4 on live server. On my local machine running Windows XAMPP, the application works fine. When I deployed it to live machine running CENTOS 7 and LAMP stack, I see a redirecting to myhostname.com/login at the top left corner of the browser and then lands on an error page showing:
token mismatch exception on line 68 of VerifyCsrfToken.php.
I had this same problem and what i did was:
First in your .env file remove: SESSION_DOMAIN
And in set session driver like: SESSION_DRIVER=file (if your want it to save to a file)
then do: php artisan cache:clear
then `php artisan config:clear
that worked for me.
Try to clear config cache on the server with :
artisan cache:config
You will need to clear config cache also if you edited config/app.php for some reason.
In addition there is an other possible reason : you copied not only the application but also the cache/session files when you deployed your application to production. Basically everything in the storage folder should be ignored on deployment.
Run this command
php artisan config:clear
Verify .env file
delete current .env file and create new .env file from .env.example
verify that config/session.php has is correct or not modified.
You can check the file permission as well of storage directory

500: Internal server error on Laravel 5.2 project

I want to upload a Laravel 5.2 project on live server.when I upload it and try to run then give me 500: Internal-Server Error.
How Can I Fix This?
In the most cases, this error happens because of folders and files permissions (in the case of laravel, may be the .env missing)
To fix this, check if you have the .env file in your folder
If not:
Generate your .env:
cp .env.example .env
Generate your key:
php artisan key:generate
After that, give the correct permissions to your laravel folder.
Enter in the laravel project
cd my_project_folder
Add the 644 permission to files and 755 to folders:
find ./ -type f -exec chmod 644 {} \;
find ./ -type d -exec chmod 755 {} \;
Clear your cache
php artisan cache:clear
php artisan config:clear
php artisan view:clear
If another error appears, try to update your composer
composer update
First Check if the domain is redirecting to your public folder.
If yes , check the .env file and the database is conected .
Clear all the cache manually :
Bootstrap : services.php, settings.php Delete
Storage/Framework/Cache Delete all files
Storage/Framework/session Delete all files
Storage/Framework/views Delete all files
or if you have ssh access :
php artisan cache:clear php artisan config:clear php artisan view:clear
If still not working . check if the permmisons for storage folder are correct.
good luck :)

token mismatch error in laravel backpack

hi there is problem with me I had made complete admin panel using laravel backpack. after uploading on domain its creating the problem when adding deleting or editing operation performs. Error is token mismatching in backpack crud system. please tell the problem with my project
I think you have issue with storage folder permission check this out Laravel Installation Docs
Directory Permissions
After installing Laravel, you may need to configure some permissions.
Directories within the storage and the bootstrap/cache directories
should be writable by your web server or Laravel will not run. If you
are using the Homestead virtual machine, these permissions should
already be set.
Another possible issue is that your variables in .env are not correct
APP_URL=http://localhost //Change this to your url
APP_ENV=local //Change this to production
After you check these things you can do this
Delete all files in app/storage/ files : cache/, sessions/, and views/
Or you can do it by using this commands if you have SSH access to the server
php artisan cache:clear
php artisan view:clear
php artisan route:clear

laravel services.json not created

Sometimes my services.json is missing after running composer update or php artisan clear-compiled.
I checked the permissions and even changed it to 777 on the storage folder but it does not help. How can I debug whats wrong?
There are no entries in my laravel log and nothing in my apache log. I'm using "laravel/framework": "4.1.*"
Just run a php artisan serve and stop, this will create the services.json file.
Ensure your web server has access to the files/folders specifically app/storage/meta/services.json if this file/folder is not there create it and add some json to see if you can accesss it in the browser.
If forbidden/denied see permissions below:
Check you have these folders
app/storage/views
app/storage/logs
app/storage/sessions
Set everything to be read/write
chmod -R 777 /app/storage
Create services.json and add the following
{
"providers": []
}
After creating the above try loading the project or php artisan serve

Resources