Raju  Dudhrejiya
Raju Dudhrejiya

Reputation: 1727

file_put_contents(): Exclusive locks are not supported for this stream, Laravel Mac OS X

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

Upvotes: 1

Views: 7303

Answers (2)

Sagun Raj Lage
Sagun Raj Lage

Reputation: 2494

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.

Upvotes: 7

turashrocks
turashrocks

Reputation: 201

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);

Upvotes: 8

Related Questions