Red Hat Bugzilla – Bug 478538
PHP run on the command-line experiences a 5 second delay before exiting
Last modified: 2008-12-31 13:51:04 EST
Description of problem:
PHP, when run as a command-line application, will experience a 5 second delay aside from the time taken to execute whatever script was run.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run a PHP script from the command-line
2. Note that it takes n+5 seconds to run
Scripts take 5 seconds longer to run than they should
Scripts should not experience any delay whatsoever
This appears to be new for Fedora 10, 32-bit. I did not experience anything like this under Fedora 9. Also, PHP run as an Apache module (mod_php5) does not seem to experience this problem.
There is a similar, if not identical, bug on Launchpad (https://bugs.launchpad.net/ubuntu/+source/php5/+bug/234927), however, the use case seems to be different than this one.
Okay, I discovered, using strace, that it was trying to resolve my computer's name with a wrong hostname (beta.local instead of beta). This appears to be a self-inflicted wound and not a real bug with PHP. Why it would matter, I don't know, but that's not really an issue. The delay disappeared when I corrected my local machine's hostname.