Laravel - Error page is blank after update from 5.3 to 5.4 - laravel

I have updated Laravel from 5.3 to 5.4. Error pages are white and do not display an error after update. I am using a local server. The specifications:
OS: Ubuntu 16.04
Nginx/1.9.15
PHP 5.6.11
I read the this question (Laravel blank white screen) and I have tried solutions:
# Group Writable (Group, User Writable)
$ sudo chmod -R gu+w storage
# World-writable (Group, User, Other Writable)
$ sudo chmod -R guo+w storage
And other solutions have been proposed. But the problem persists!
Also, Application debuggin in .env and config/app.php is true.
Who can help?

After update your laravel you may clear all your cache and your compiled page. Try to do this:
php artisan view:clear
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan clear-compiled
php artisan optimize

Related

Php artisan serve in laravel

I am new in laravel development. I am using latest version 9 of laravel, when I write php artisan serve in git bash or in VS code terminal after sometime it gives an error. I attached a screenshot of an error.
run php artisan optimize command
composer install
composer update
php artisan optimize:clear
This will clear all the cache of the application

Laravel8 storage files not found

php artisan storage:link
local worked fine.
After deployment without start php artisan serve it doesnt find the files in storage.
Symlink is online.
ok if I make symlink on my own it worked fine.
use
ln -s ../storage/app/public storage
instead of
php artisan storage:link
If you have access to ssh or to the remote terminal:
php artisan storage:link
php artisan config:clear

BindingResolutionException Target class [hash] does not exist after deploy

I wanted to deploy my laravel 8.0 project via ssh pull to production. I did composer update in ssh to my ubuntu server and after that my website is down and showing 500 error.
when I turn on debug mode in production it shows below error:
Target class [hash] does not exist.
my website worked well before pull and composer update and after that this happened.
also there is no problem in local environment and it works properly.
my .env file in production also exists and the details are set.
I have tried lots of ways for resolving the error but none of these works:
changing permisions for bootstrap and also for the whole project :
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
removing and reverting bootstrap folder
composer dump-autoload
php artisan config:cache
composer update and sudo composer update
I also tried these commands but none of them worked:
php artisan route:clear
php artisan view:clear
php artisan config:cache
php artisan cache:clear
php artisan config:clear
I've searched alot and tried many ways but no result.
could any one say what is wrong please? thanks alot.

There is no existing directory at /storage/logs and its not buildable: Permission denied

I have a problem with my Laravel deployment on a OVH web server.
After made
composer update
php artisan cache:clear
php artisan route:clear
php artisan dump-autoload
I have this answer:
There is no existing directory at /storage/logs and its not buildable: Permission denied
I put all the files on 777 chmod but I have always this answer.
Please try the following commands
php artisan route:clear
php artisan config:clear
php artisan cache:clear
Note: In case you are a Homestead & VirtualBox user, please be sure that your VirtualBox is up to date.
It helped in this thread at laracasts
Clear the cache and config, then deploy to the live server.
If you've already uploaded to the live server, then you have to follow these steps:
Delete bootstrap/cache/config.php
Delete all log files in storage/logs.
You don't need to add any permission on the storage file.
The main problem here is in the compiled file, and due to which laravel try to show an error.
By default in laravel, storage file not having permission to show in the console (error
shows from the error.log file).
So the thing you need to fix is to fix compile file. which can be done thought this single command
Use this
php artisan optimize:clear
This command will clear all your cache
Compiled views
Application cache
Route cache
Configuration cache
After changing local conf i got the same error over and over,
try this, probably will help.
rm bootstrap/cache/config.php
and then
php artisan cache:clear
depending on your scenario, reloading auto-loader file can solve your issue, for that use :
composer dump-autoload
or sometimes just try :
composer install
this do the two the commands listed above.
go to your vagrant
then run
vagrant ssh
php artisan config:cache
Run the following command if you can access your server terminal
php artisan route:clear && php artisan cache:clear && php artisan config:clear && php artisan config:cache
If you are on shared hosting and cant access the terminal go to your web route file in routes/web.php and make a temporary link such as shown:
Route::get('reset', function (){
Artisan::call('route:clear');
Artisan::call('cache:clear');
Artisan::call('config:clear');
Artisan::call('config:cache');
});
Then go to http://your-domain/reset to execute the commands. there after you can now access your website as normal
If you are using homestead (vagrant) in Laravel then follow the steps #Farid shahidi provided
vagrant ssh
cd /home/vagrant/code <-- your file usually resides here; see your Homestead.yaml configuration
php artisan config:cache
You Have to try artisan command in this way
php artisan cache: clear
php artisan config:cache
php artisan cache: clear
This one-line command solves my issue:
php artisan config:cache
Delete bootstrap/cache/config.php from your laravel deployment on the server.
Please run the below commands:
php artisan route:clear
php artisan config:clear
php artisan cache:clear
This one worked for me in case your project is located within /var/www/html/
sudo chmod -Rf 0777 /var/www/html/{project-name}/bootstrap/cache
sudo chmod -Rf 0777 /var/www/html/{project-name}/storage
You need to run this command from the terminal.
php artisan config:clear
php artisan config:cache
I got the same issue, I change the permissions of the folders inside the the storage folder.
chmod 777 <folder_name>
I'm not sure about this security wise. but this resolve my problem.
I change my file settings to 755 also work for me.
try this
remove your "vendor" folder
Run "composer install" or "composer install --ignore-platform-reqs" on your cmd or terminal
php artisan config:cache
php artisan config:clear
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan config:cache
if you are using linux:
service apache2 restart (just in case)
if you using xammp:
just restart your xammp
For those of you using sail, do:
sail artisan optimize:clear

Reload .env constants in Laravel 5.2

I just changed a constant inside my .env file. The new value is shown up correctly with php-cli (via tinker), but not in my web app (php-fpm).
So far I've tried everything as suggested:
sudo service nginx restart
sudo service php7.0-fpm restart
sudo service php7.0-fpm reload
.
php artisan config:cache
This will generate a cache config file in bootstrap/cache/config.php
php artisan config:clear
This will remove cache config file in bootstrap/cache/config.php
php artisan cache:clear
What exactly does does ? What type of cache does it clear?
php artisan clear-compiled
This clear compile classes
composer dump-autoload
This will generate/update composer autoload file.
I have some .env variables that are not part of any config file. So it is useless for me to run any of the artisan commands.
None of the above php artisan commands don't deal directly with $_ENV.
Seems that $_ENV is stored somewhere in the server and laravel cannot update it once properties are populated.
The only solution I've found is restarting the server.
I'm running a Laravel Forge instance.
If it is cached and you need to reload it you can simply use:
php artisan config:clear
This will pull in any changes that you have since made.
Try to delete the config on file on: Bootstrap/cache/config.php
AS well you can try: php artisan config:cache or php artisan cache:clear

Resources