tags:

views:

639

answers:

3

When running PHP in CLI mode, most of the time (not always), the script will hang at the end of execution for about 5 seconds and then output this:

Error in my_thread_global_end(): 1 threads didn't exit

It doesn't seem to actually have any effect on the script itself.

Some web searches turned up blogs which suggest replacing the php_mysql.dll with a different version, however this has not solved the issue for me, and I suspect the info from those blogs is now out of date.

My setup:

  • PHP Version 5.2.4
  • Apache/2.2.4 (Win32)
  • Windows Vista Home Premium SP1
A: 

Did you take a look at this resource? You may want to double check that you got a specific libmysql.dll (5.2.1) that is unaffected by this, and also to double check that you don't have any stray mysql libraries lying around that PHP could be picking up instead. Or, switch from FastCGI if that's an option for you.

For interests sake, the bug appears to be best detailed here. The general idea of the problem (from the mysql bug link) appears to be:

Whenever a new thread is created libmysql is told about that by Windows. It then     
increases a thread counter and initializes some data. When libmysql is being unloaded
it checks whether all threads have finished, if not it tries to tell them "close now"
and gives them 5 seconds for that. In general this works in a nice way.
Owen
Heh, nice coloring! :-p Try blockquote ( "> text") instead of indentation which enables syntax highlighting.
Avel
+1  A: 

This is a known bug with some of the PHP 5.2.X version in the windows fast-cgi implementation

http://bugs.php.net/bug.php?id=41350&edit=1

I have encountered this bug before and downgrading my PHP install to 5.2.0 solved the problem.

D-Rock
+1  A: 

There is no need to downgrade the entire PHP version, just replace the libmysql.dll from the PHP 5.2.1 release & things should be rolling :) Refer this link for more info.