Re: [PHP] Persistent flag in memory

[email protected] (Jochem Maas)
Newsgroups php.general
Message-ID <[email protected]>
Op 2/11/10 5:42 AM, Teus Benschop schreef:
> Thank you for the hints given. I'll look into the various options given.
> The main reason for the need for a persistent flag in memory is that
> several installations where the PHP code would be deployed do not have
> access to crontab, so I am simulating crontab's functionality by letting
> a PHP script run forever. Page visits would start that script, but once
> the first visitor has started the script, next visitors would only start
> it if the script had died. Here is where the persistent flag is needed.
> Normally the script will never die unless at server reboot, or perhaps
> if some timeout limit has been exceeded. If I would touch a file in the
> filesystem as a flag, this would persist even after server reboot, so
> that means that my simulated crontab would never restart, since it looks
> like it runs. Teus.

whatever it is that your trying to do, it sounds like one of two things:

1. you have hosting that is unsuitable for your needs
2. you are tackling the problem incorrectly

at any rate, as far I'm concerned, you should never have a long running
php process via a web server. (obviously this is the point that someone
posts a brilliant use case to prove me wrong ;-)

could you detail what is is you're actuallt trying to do, chances are people
have:

a. got a better alternative
b. already invented the particular wheel you're trying to build
c. you really do need shell (or even just control panel) access to run a cron job

>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.