Discussion: confused by php ticks
Afficher un message
Vieux 26/03/2008, 18h22   #2
Erwin Moller
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: confused by php ticks

actioncem@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
  Réponse avec citation
 
Page generated in 0,05231 seconds with 9 queries