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
Related
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
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
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.
We lost our config.php file and the site instantly broke. We tried putting an empty config.php file but no luck. Restarted the server but also no luck. What's strange is that we didn't have a config.php file earlier that day. Our live app is running without a config.php as well.
To clarify, this file resides in /bootstrap/cache/config.php
Thanks!
You can try to run php artisan config:clear from the command line to clear the config cache or php artisan config:cache to create a new config.php. Note that you need to use config() instead of env() in your code if you want to use config cache
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