file_put_content error : failed to open stream: Permission denied
Hi all,
i'm updating an laravel app from 5.5 to 5.8 by add all the update states (5.5 to 5.6.....5.8) and all is working on my windows developpement sys.
But i want to clone this state to my osx alternative developpement environnement and i have some strange acces error :
file_put_contents(/fgTrTnBjujXVEJLAvRSUak4PmDhNjKdqytkNwuHb): failed to open stream: Permission denied
i know that rights on directorys and files must be set to good level, but even i set 777 access right to all directorys and files for i get this error on index.php access. It's certainly on session write but can't figure why i get this error.
I have use all the cache clear commande and dump autoload after each access right modification without result.
I have the views and session directory in storage directory to...!
Any one know about this ?
I'm really in trouble for my app update.
@maverickchan i have even made cache:clear clear-compiled view:clear config:clear and dump autoload but without result.
@ Sinnbeck : this is the exact error message :
file_put_contents(/fgTrTnBjujXVEJLAvRSUak4PmDhNjKdqytkNwuHb): failed to open stream: Permission denied
the file initiator is /vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php in my app and yes it's strange that the error point to the hdd root.
this is the session that try to write a file but i don't use file session system but cookies....
Maybe the updating session system change something from 5.5 to 5.8..?
For other in the same trouble, I found the solution :
Sham on me, my first mistake was i have one line in .env file with SESSION_DRIVER=file that overide my first SESSION_DRIVER=cookies in then file ....
And on update process from 5.5 to 5.6, i need to delete the trustedProxy.php in config and update http\middleware\TrusProxies.php to :
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}
next, config:clear cache:clear clear-compiled and composer dump-autoload.