1
votes

I'm using mac os x Sierra, I installed laravel and try to resolve error but could not succeed can anyone help me please, I follow the below steps.

  1. change permission on storage folder.
  2. cache clear.
  3. Composer updated.
  4. mac os x Sierra
2
As with most questions on SO you will get a better result from the community if you post your codeRiggsFolly
@RiggsFolly thank you it's totally fresh larave project. <code>file_put_contents(): Exclusive locks are not supported for this stream</code>Raju Dudhrejiya
Ok, so what were you attempting to do when you received this errorRiggsFolly
are you using vagrant?Erubiel
I don't have an idea about vagrant.Raju Dudhrejiya

2 Answers

8
votes

Change the line of code Filesystem.php to

from this

return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);

to

return file_put_contents($path, $contents, $lock ? LOCK_SH : 0);
8
votes

I solved this problem on my MacBook Pro (running Mojave) by going to my LaravelProject's folder first. Then I navigated to LaravelProject's vendor\laravel\framework\src\Filesystem\Filesystem.php and searched and modified

return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);

to

return file_put_contents($path, $contents, $lock ? LOCK_SH : 0);.

If any kind of confirmation is asked while modifying this file, confirm it.