I'm using Laravel 5.4 on Windows 7 and Xampp 3.2.2. A few days ago Laravel started ignoring the changes I was making to the .env file. I couldn't find the solution so I reinstalled Laravel in a different directory and imported my app folder.
Now Laravel just stopped responding to the changes I am making to some PHP files. I added a function to the /vendor/illuminate/support/helpers.php but I could not access it in the view. I deleted the content of the whole file and I could still access the function previously declared in it.
I created a helpers file as instructed here but that too is being ignored.
Any changes to any views is immediately effected and php artisan cache:clear is not doing anything.
How is this happening? Does it even make sense?
Laravel caches config values to improve performance.
You need to run either (recommended)
php artisan config:cache
which will cache the new values you have, or
php artisan config:clear
which will turn off caching. I've had some experience with this causing errors though.
I know it might sound rather stupid, but have you remembered to restart the server because you've edited the .env file?
Related
I'm having a strange problem when updating a Blade view in a Laravel project hosted on a Linux CentOS server. The changes I make (deleting or commenting out a line of html) are not reflected on the webpage. I tried clearing the view cache with php artisan view:clear to no avail. When I go to /var/www/app/storage/framework/views and check the compiled php view the changes are there, but they still don't show up on the webpage. The old version of the view must still be stored somewhere, I just can't figure out where. Any help is much appreciated.
Edit: As an addendum, I also tried php artisan cache:clear as well as clearing the browser cache and neither worked.
Linux CentOS release 7.3.1611;
Apache 2.4.6;
PHP 7.1.7;
MySQL 5.5.52-MariaDB;
Laravel 5.3.31.
Run
php artian view:clear
OR for broad prospective, run
php artian optimize:clear // This is available for post Laravel 6 versions
If you are using chrome open dev tools, then settings and check disable cache
option
It works like a charm for me.
I'm running a Laravel 5.8 project on PHP 7.2 and I use PhpStorm is my editor on Mac OS 10.15.4.
Since recent, when I write new code, most of the time in a Class, my changes do not take effect in the application itself. PhpStorm and other editors show my new or edited code, but nothing changes in my application. The only thing that solves this issue is a full reboot of my computer. Doing a full reboot and starting everything up again takes a lot of time and time is precious.
What I have tried other than a full reboot:
Restarting PHP
Restarting Nginx
Restarting PhpStorm
Restarting using valet restart
Removing the project and cloning from git repo again
Clearing my config > php artisan config:clear
Caching my config > php artisan config:cache
None of these had any successful results so far.
What could cause this weird bug and is there a way to fix this?
Any help or information regarding this is well-received.
You can add code
ini_set("soap.wsdl_cache_enabled", 0);
or manualy remove all wsdl* files in your /tmp folder on the server.
WSDL files are cached in your default location for all cache files defined in php.ini. Same location as your session files.
In PHP how can you clear a WSDL cache?
I'm using a Mac. Can not execute the command
php artisan cache:clear
I get in return:
Failed to clear cache. Make sure you have the proper permissions.
This is for Laravel. Any ideas how to fix this?
create storage/framework/cache/data directory manually.
This could be one of several things(need more information to narrow it down):
No cache files/records exist.(Updated to reflect your latest comments)
If you are running a webserver (apache or ngix) as a different user, then you won't have permissions to the files as yourself.
If you are using a cache driver other than file, like redis or database, make sure the credentials provided are correct.
There could be a bug in the version of Laravel you are using; this would be unlikely.
Expansion on points 1 and 2:
This is normal behavior. If you have opened pages expecting them to be cached and they are not, split the page and utilize #include directives splitting out the dynamic and static elements of the page into separate blade files.
I like to add my user to the same group as the web server's group(www). Then change the group for all of the files to www, with group read permissions, and write permissions only on the bootstrap/cache and storage directories.
I think it might possibly be a bug with the latest version of Laravel, however unlikely it may seem. I started a new project today and installed a fresh copy of Laravel 5.7 and it seems to cause the error above. However, if I use 5.6 then the error does not appear.
I have a Laravel app, been using a specific set of database settings for a very long time, now I uploaded the whole application to CPanel and trying to change both the .env and .env.example files but still, when I look at the error logs uses the old database details, am stuck. Thanks in advance.
After cracking and scratching my head several times, I actually used these laravel CLI commands
php artisan config:clear
php artisan cache:clear
Now everything is working okay. Of course I took it offline first and used htdocs until it worked okay then uploaded the latest files.
I'm not sure if you are using the latest laravel framework 5.4 but you can try the following:
Clearing the config cache with this artisan command
php artisan config:clear
Checking the environment
php artisan env
With this command you can make sure that you are running under the correct environment. If you are using specific .env file such as ".env.local" or ".env.dev" etc.
Make sure there's nothing wrong with your dbms installation and try to connect to another blank db.
Hope this helps you!
I have deployed a website made with Laravel to my server. I have changed all the configurations but when I run it on browser, it gives me PDO error.
I figured out that Laravel configuration has not been changed even though I have.
It was certain that laravel was caching my old db configurations, so
I tried
php artisan:cache clear
But it didn't work.
Anyone has a solution?
php artisan config:clear for Remove the configuration cache file