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
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 have just begun to work in a working project. I was trying to mount a docker-compose set of servers for DB, Lumen, and more. When I try some command involving artisan (just like php artisan --versionor php artisan migrate) I get the error message:
No memcached servers added
Well, then I go to Laravel docs to see how memcached cache driver works and it says that this is configured in config/cache.php. Well, this project has no cache.php file. In the other hand, the .env file does not contain CACHE_DRIVER environment variable.
I tried mounting a memcached server dockerized, but still same error. Where can I configure the memcached server nor socket in the project if I don have any configuration related to memcached???
Could this be happening 'cause Laravel finds no cache configuration and it selects any driver with no configuration?
Finally I could reach the solution by myself. Thanks everybody for watching.
When a Lumen project has no .env file configuration files gets some strange configurations. In this case was using memcached as server driver.
Solution: Create a .env file and set the cache driver.
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?
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!