logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: php5apache2.dll for using with DBG.
Author
maniac



Joined: 29 Mar 2006
Posts: 31
Location: Ukraine

PostPosted: Mon 17 Jul '06 1:08    Post subject: php5apache2.dll for using with DBG. Reply with quote

Or if your apache segfaults on service shutdown.

just commented out tsrm_shutdown() function.
It's not a real solution but may work for you too.

http://pzskc383.dp.ua/php5apache2.dll
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Tue 18 Jul '06 13:29    Post subject: Reply with quote

What is DBG and where do you commented out tsrm_shutdown() ?


Steffen
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 18 Jul '06 13:39    Post subject: Reply with quote

I belive that tsrm_shutdown() is one of the main shutdownfnction in PHP soure. often heared that in dev list. I think the comment out the call of that function. tsrm_shutdown() is normaly called when PHP ends. Like in PHP script register_shutdown_function(tsrm_shutdown()); Ok bad example, but that is the way is likely works. I don't know what tsrm_shutdown() do, but think it clean memory and some other stuff.
Back to top
maniac



Joined: 29 Mar 2006
Posts: 31
Location: Ukraine

PostPosted: Tue 18 Jul '06 17:24    Post subject: Reply with quote

dbg is a debugger for php - imho the best one
http://dd.cron.ru
it has two version - opensource and more powerful proprietary, that ships with nusphere phpEd.

Here is my conversation with DBG's author. Long story short php crashed whole apache when it stops or simply when running many scripts at once.

module was compiled from sources. dbg ver 2.13, php 5.1.4

TSRM.c.patch that claimed to fix this problem didnt work for me.

so I decided to comment call to tsrm_shutdown() in sapi_apache2.c as adviced and all works fine. no memory leaks or crashes detected.

And then I posted this file here, think it might be helpful.
dbg used not only in nusphere phpEd, but in eclipse and many other small IDEs. Personally I use it frequently.

PS: no I'm not advertising this product, I simply like it (:
you can also try xdebug and apd from PECL
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Tue 18 Jul '06 17:31    Post subject: Reply with quote

Thanks for the very good explanation.

James,
Maybe you can try the .dll from maniac for your Shutdown issue in typo3.

Steffen
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 18 Jul '06 20:00    Post subject: Reply with quote

I looked at that function in sapi_apache2.c and tsrm.c
Yes as I said. I frees memory and frees resources. In the code I saw that it is alllowed only to call the function once. maybe while shutdown caused, by the new win mpm (threads) it tries to shut it down more than one time. (only brain storming my C++ is like zero Wink )
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Tue 18 Jul '06 22:06    Post subject: Reply with quote

Maniac,

I tried your .dll above. And indeed my server is not crashing anymore when stopping/restarting the server. I had a crash at shutdown since I use APC.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Wed 19 Jul '06 10:51    Post subject: Reply with quote

Hm, my preformance test showed that the new dll works slower than the old one. (made some heavy actions with phpMyAdmin) Compiled with a different SDK?
The other thing, I'm not sure what means the different file size.

  • 26.112 Bytes Steffen php5apache2.dll
  • 23.552 Bytes php5apache2_no_tsrm_shutdown.dll


Such a different size only caused by commenting out one call of a function??? Question 3kb is much

One positiv is that Apache don't crashes anymore, but preformance is more important for me! I'm gonna check that out at home tonight with some benchmark scripts.
Back to top
maniac



Joined: 29 Mar 2006
Posts: 31
Location: Ukraine

PostPosted: Wed 19 Jul '06 15:14    Post subject: Reply with quote

hm...

Compiled with visual studio 2005 express & platform sdk.
Linked against php5ts.lib found in standart php distribution and self-built apache libraries.

BTW, no resources embedded into file.

*thinking of compiler /O flag*
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3049
Location: Hilversum, NL, EU

PostPosted: Wed 19 Jul '06 16:00    Post subject: Reply with quote

I build php complete with --enable-snapshot-build and Visual Studio 2005 & Platform SDK - March 2006 Edition


Steffen
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Wed 19 Jul '06 19:42    Post subject: Reply with quote

Hm, was wrong! Can be that the company PC don't run well. Quit old.

My Benchmark results:
Start: 1153330367 Steffens DLL
Finish: 1153330376 Result: 9 sekunden

Start: 1153330483 no_tsrm_shutdown_DLL
Finish: 1153330492 Result: 9 sekunden

my Benchmark script (if anyone want to show of, he must be faster than me Wink )

Download the benchmakr script here
Back to top


Reply to topic   Topic: php5apache2.dll for using with DBG. View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules