On 26 Mrz., 17:22, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.com> wrote:
> action...@googlemail.com schreef:
>
>
>
> > I am discovering some really weird behaviour of php while using ticks
> > and register_tick_function(). I've already searched the web and some
> > newsgroups, but I didn't find any suitable postings for my problem.
>
> > Here comes an example script:
>
> > <?php
>
> > // define tick function
> > function checkUsage() {
> > echo ".";
> > }
>
> > // register tick function
> > register_tick_function('checkUsage');
>
> > // declare ticks
> > declare(ticks = 1);
>
> > for($i = 0; $i < 1000; $i++) {
> > echo '|';
> > }
>
> > ?>
>
> > If you execute this script, you can see, that php is doing some ticks
> > before the for-loop passes by the first time. That's no problem - yet.
> > If I execute the script immediately again, the ticks between the loop
> > passes counting higher and higher. I need to wait about one minute
> > till the output is as expected.
>
> > Can someone explain that to me?
>
> > Cheers,
>
> > Cem
>
> > P.S.: I'm sorry for my poor english 
>
> Hi,
>
> Could it be that you run this script on a threaded webserver?
> What webserver did you run this script on, and how is its PHP installed?
> (eg CGI, ISAPI, etc)
>
> I ask this because:
>
>
Citation:
> Warning: register_tick_function() should not be used with threaded web
> server modules. Ticks are not working in ZTS mode and may crash your web
> server.
>
|
>
> From:http://nl.php.net/manual/en/function...k-function.php
>
> Personally I would avoid all these tick functions totally. :-)
>
> Regards,
> Erwin Moller
Hi,
I run this script on a Virtuozzo VM with Linux. It's a common apache
(apache 1, not 2) installation with PHP as module.
I must confess that I do not really understand the warning in the
documentation. What is a threaded web server module? What is that ZTS
mode? Anyway, same procedere when I execute the script on the command
line.
(BTW: If I execute the script in a Windowx XAMPP environment, apache
crashes).
Cheers,
Cem