Jump to content

peter844

New Members
  • Posts

    5
  • Joined

  • Last visited

peter844's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. @kicken Thanks for your reply, I know about the possibility of fopen and flock, I have the same problem with PHP semaphore, the problem is caused only by Google Chrome, when I disable the browser cache (in Google Chrome), it works like expected, even if there is no cache headers in the response and even when I insert a no-cache header into the response, when aj insert to response PHP's process ID, pid is not the same, it doesn't make sense for me another solution https://www.php.net/manual/en/function.getmypid.php#112782
  2. Prevent multiple execution of long running script, sorry, but it's clear from the code, you probably don't understand how the code I pasted here works, nevermind
  3. Sleep is for debug, i need to execute scripts simultaneously in same browser, i need first script running when execute second script, clearstatcache clears file status cache, first script run create file and then sleep for 20 seconds, but second simultaneously script run (for example executed 3 seconds later) do not see the created file "/tmp/monkey.tmp" https://www.php.net/manual/en/function.sleep.php https://www.php.net/manual/en/function.clearstatcache
  4. I don't understand why but it is caused by the Chrome browser cache, the response from the server does not contain any cache headers, when I disable browser cache, it works like expected
  5. Hello! I'm trying to understand why this script doesn't work, when I execute script simultaneously in same browser or browser tab, second script do not see the created file "/tmp/monkey.tmp" (php7.4-fpm + nginx, default config, opcache enabled) As soon as I used two different browsers, it works like expected, if I execute same script/URL simultaneously and one script with random data for example URL?_=monkey, it works like expected, problem is same URL in same browser, I dont understand why $tmpfile = '/tmp/monkey.tmp'; clearstatcache(); if(file_exists($tmpfile)) { die('file exist'); } else { file_put_contents($tmpfile, 'blabla'); } sleep(20); exit;
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.