You should put a lock on the file:
$fp = fopen($updateFile, 'w+');
if (flock($fp, LOCK_EX)) {
fwrite($fp, 'a');
flock($fp, LOCK_UN);
} else {
echo 'can\'t lock';
}
fclose($fp);
More Related Contents:
- PHP & Sessions: Is there any way to disable PHP session locking?
- should LOCK_EX on both read & write be atomic?
- Read and write to a file while keeping lock
- recurring system my sql query [closed]
- PHP/SQL Query Not Showing Results
- Gather column name of a table from database [closed]
- Wysiwyg for dynamic blocks of content? [closed]
- How do I add PHP code/file to HTML(.html) files?
- PHP DOMDocument loadHTML not encoding UTF-8 correctly
- How to make a PHP SOAP call using the SoapClient class
- How to use XMLReader in PHP?
- How to get video duration, dimension and size in PHP?
- PHP, MySQL error: Column count doesn’t match value count at row 1
- Composer error: “PHP extension fileinfo is missing from your system”
- Strip all HTML tags, except allowed
- Uploading in Codeigniter – The filetype you are attempting to upload is not allowed
- Can you put PHP inside PHP with echo? [closed]
- SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO [duplicate]
- A conditional element inside an array(…) construct
- What does yield mean in PHP?
- PHP foreach loop through multidimensional array [duplicate]
- How to prepare statement for update query? [duplicate]
- Use of PDO in classes [duplicate]
- Getting complete PATH of uploaded file – PHP
- Which line break in php mail header, \r\n or \n?
- How can I pass variables from JavaScript to PHP?
- How do I enable PUT requests in Azure?
- Push item to associative array in PHP
- Is Multiple Inheritance allowed at class level in PHP?
- Unable to make php curl request with port number