Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel League\Flysystem\Exception: Impossible to create the root directory

I have this code which works perfectly on my local pc (MAC), but when I push everything into production this error appears:

local.ERROR: League\Flysystem\Exception: Impossible to create the root directory

foreach (explode('#', $pics_urls) as $url)
            {
                $curlCh = curl_init();
                curl_setopt($curlCh, CURLOPT_URL, $url);
                curl_setopt($curlCh, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt($curlCh, CURLOPT_SSLVERSION, 3);
                $curlData = curl_exec($curlCh);
                curl_close($curlCh);
                if(!empty($curlData)) {
                    Storage::disk('local')->put('public/photos/' . $bid->lot_id . '/' . ++$num . '.jpg', $curlData);
                }
            }

How can I fix this problem?

like image 540
Dmitry Malys Avatar asked Oct 25 '25 03:10

Dmitry Malys


1 Answers

I just had this error. It was actually the same error but one of the project dependencies was trying to create a folder called /something and it was failing because my user didn't have permission to create folders in the root of the hard disk.

The solution for me was to do sudo mkdir /something, and then composer install worked.

It's definitely permission related if anyone else stumbles into this.

like image 84
agm1984 Avatar answered Oct 26 '25 17:10

agm1984



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!