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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With