exit(): Takes forever to shutdown PHP Command-Line app

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeff00seattle
Forum Commoner
Posts: 66
Joined: Sat Feb 28, 2009 3:27 pm

exit(): Takes forever to shutdown PHP Command-Line app

Post by jeff00seattle »

I have put together a PHP Command-Line application and I am using exit(0) to shutdown application.

By the way, this command-line app is running on Windows 7.

When this app exits, it takes between 50-to-60 seconds for command prompt to return.

It is kind of embarrassing when demoing this app because it has the impression of hanging.

Is there any way that I can accelerate a PHP command-line app?

Thanks

Jeff in Seattle
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: exit(): Takes forever to shutdown PHP Command-Line app

Post by pickle »

How do you know it takes that long after exiting. More likely it's taking that long to execute.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
jeff00seattle
Forum Commoner
Posts: 66
Joined: Sat Feb 28, 2009 3:27 pm

Re: exit(): Takes forever to shutdown PHP Command-Line app

Post by jeff00seattle »

I know I am at the end because I have an echo "Finished", then I stop-watch it.

However...
I did a php -m, and it also has a delay of 50-to-60 seconds, even after listing all the modules.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: exit(): Takes forever to shutdown PHP Command-Line app

Post by requinix »

PHP 5.2? I have problems like that, but the delay is only a couple seconds.

I suspect it's an extension or three. Disable everything and see if that makes a difference.
Post Reply