0

Assume multiple people write to the same file at the same time with the command

file_put_contents('file.txt', 'This is an example', LOCK_EX);

would it be possible that one person might not be able to write to the file, because the function file_put_contents had to wait too long for the locked file? Would the function throw an exception, or would you just end up with a error like this:

"Fatal error: Maximum execution time of .. seconds exceeded"

Adam
  • 25,960
  • 22
  • 158
  • 247
  • Does https://stackoverflow.com/questions/18833448/php-flock-behaviour-when-file-is-locked-by-one-process help? – Nigel Ren Dec 08 '17 at 12:19

1 Answers1

0

That error looks like execution timeout for the script (time taking to execute the script is beyond the configured value as process is waiting to accurire the ) , there will be default timeout you can check the default max-execution-time in php.ini file

max-execution-time=30

you can tune the timeout and check http://php.net/manual/en/function.set-time-limit.php or max-execution-time

Mahesh Hegde
  • 1,131
  • 10
  • 12