php artisan serve does not allow change .env file - laravel

I found the problem
if i restart php artisan serve the changed values are applied. this is
the norm? how can i solve this
I created a router where I output config information
I'm trying to change value from .env file, for example APP_NAME, from APP_NAME="Nuxt + Laravel" to APP_NAME="test" but the change is not displayed on the page!(of course I reloaded the page 😊)
I was trying to look through php artisan tinker
It works!
But my config remains the same. I can not solve this problem for a week now.
I cleared the cache!!! I tried php artisan cache:clear, php artisan config:clear (i tried all command for cache)
CACHE_DRIVER=file
I deleted files bootsprap/cache/*, storage/framework/cache/*.
I tried everything!!!
I have this project on the github: https://github.com/iliyaZelenko/laravel-nuxt.
Please help me, I want my project to be used by other people.

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 vuejs. In vue files data from .env file shows wrong value

guys. I'm working on laravel 8 + Vue 3. I real server .vue files (console.log(process.env.MIX_APP_URL) - for instance) shows wrong values from .env.
I checked my .env file in server:
MIX_APP_URL=https://laravel.process.kz.
But in .vue files it gives me "http://localhost:8888/laravelprocess".
I tried php artisan config:cache, php artisan config:clear, php artisan cache:clear, php artisan key:generate etc. Please, help to find out whats the problem.
If you change the env file you might need to restart serve if its still running.
It might also load additional .env files for instance:
.env # loaded in all cases
.env.local # loaded in all cases, ignored by git
.env.[mode] # only loaded in specified mode
.env.[mode].local # only loaded in specified mode, ignored by git

Changes not showing up when changing a file in laravel

I have a file in my resources/lang folder and when I made a change to it, it didn't show up on my site.
I've tried php artisan cache:clear, php artisan config:clear, php artisan view:clear, but still no change
Try to clear views folder in Project/storage/framework. It might be an issue.
Have you tried your site on another browser ?

how to make changes in .env file without reloading server

I am using a form from front end to change my .env file variable values, after changing the values, changes are being saved in my env file, but its not reflecting on my laravel application, after restarting my server its reflecting on my website, but i cant do this if its in live server, I tried PHP artisan config:clear and PHP artisan cache:clear but none of its working.
Can anyone please tell me how to do this without restarting server.
I am trying to change these values in .env
HTTP_HOST=http://
SFTP_HOST=10.10.10.64

Laravel page shows "This page isn’t working" instead of errors

My laravel project is standing on xampp on windows. Whenever I make a critical error (a typo for example) i should get an error, but instead I'm seeing "This page isn’t working" in google chrome.
I've seen similar problems, but I have no idea how to fix this on Windows.
I have APP_ENV=local and APP_DEBUG=true.
In your .env file, make sure you set APP_DEBUG=true
APP_ENV=local
APP_DEBUG=true
Then run
php artisan config:cache
php artisan config:clear
Sometimes, after running these two commands, Laravel still not reading the env configs, so what worked for me every time is to set the app to maintenance mode then set to live again.
php artisan down then in few seconds, run php artisan up.
another cause:
Make sure in your env config, there are no spaces, if you have a value with spaces make sure to enclose it with quotes (" ").
Turn on Laravel debug by change .env file
APP_DEBUG=true
or in config -> app.php change this line:
'debug' => env('APP_DEBUG', true),
And finally, clear laravel cache :
php artisan config:cache
Hope this helpfull
The error was caused, because I was using the wrong PHP version.
I had XAMPP installed with 7.2.5 PHP version and had to downgrade to 7.1.13.
This error is because the server ran out of memory (Allowed memory size of X bytes exhausted) before it could return an error. Try increasing your memory in php.ini

Resources