The title is pretty clear:
I have a PHP file and I want it to be executed only the first time even if 100.000 users try to access it at the same time.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could do this with a lock file you write to the server, like:
But maybe a database-solution would be more sophisticated as I’m not a 100% sure that the file solution works for 100.000 concurrent requests.
create your table
do something like this on request
This uses a unique key and relies on the database consistency.