Code Tips and Snippets


Not yet member?
Click here to register.
Only members can post comments

News on "4 stars level"

Allow only a single instance of a php script to run at the same time
Posted by pk on Sunday, September 21 2014 - 16:37:43
4 stars levelphp languageLinux operating system

What a good idea to administer a Linux server by writing php scripts instead of shell scripts ...

We have already seen how to run php scripts with suid root permission

Frequently, we need to run a script that must not be run several times at the same time...we say that we want to run only a single instance of the script at the same time.

We will use php classes to achieve that... especially the fact that when a script ends, the destructor of instancied objects is automatically called.


 
yakpro rulez!

Site has been updated on Thursday, May 25 2017 - 09:16:27