apache_error.log The process cannot access the file because it is being used by another process
Posted by: coderZev (---.nycmny.fios.verizon.net)
Date: December 09, 2018 06:26PM

Hi

I have a program that requests the content of a json file from the file system. Sometimes I notice the line "The process cannot access the file because it is being used by another process" in the apache_error.log file.

I think I know why this is happening. A different program opens the file, writes the most up to date information and closes it. So if the client requests it when it's open, I would expect to get this error.

The question is, does it retry, and how many times, and how long does it wait in between retries? Is there a way to set this? It there a way to see if it has exhausted the number of retries.

I realize that this is a rudimentary question. So rudimentary, in fact, that I didn't even find it in the FAQ's. I am a little new to apache, so any help would be appreciated

Zev

Options: ReplyQuote
Re: apache_error.log The process cannot access the file because it is being used by another process
Posted by: RiggsFolly (Moderator)
Date: December 09, 2018 07:08PM

No automatic retry.

You are going to have to come up with a mechanism to serialise access to this file.

However this is nto a WAMPServer issue, so I suggest a Google on the subject of serislizing access to a disk file in PHP would be a good idea

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.