Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 5.5.6 CLI very slow #102

Closed
huckeduster opened this issue Jan 3, 2014 · 23 comments
Closed

Version 5.5.6 CLI very slow #102

huckeduster opened this issue Jan 3, 2014 · 23 comments

Comments

@huckeduster
Copy link

This could almost be a copy of issue #82. Details:

PHP version: 5.5.6
Mac OS X: 10.8.5

Problem:

Andre@macgyver~: time php -v
PHP 5.5.6 (cli) (built: Nov 14 2013 12:34:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick Rethans

real 0m5.052s
user 0m0.033s
sys 0m0.015s

I deactivated all extensions in /usr/local/php5/php.d, but still get this 5 seconds delay. Had this some time ago (probably with MAMP) and the solution was to deactivate the IMAP extension. But there is no IMAP extension to deactivate as far as I can see.

I don't know whether this is a cli only problem, cause I don't use builtin apache server.

@mbadolato
Copy link

Not seeing it here; default install.

PHP 5.5.6 (cli) (built: Nov 14 2013 12:34:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick Rethans

real    0m0.511s
user    0m0.019s
sys     0m0.037s

[camac01 mbadolato /usr/local master]$ time php -v
PHP 5.5.6 (cli) (built: Nov 14 2013 12:34:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.2.2, Copyright (c) 2002-2013, by Derick Rethans

real    0m0.029s
user    0m0.017s
sys     0m0.011s

@huckeduster
Copy link
Author

Switched to Homebrew. No issues there (their 5.5.7 version doesn't have imap compiled in by default, possibly a reason).

@chregu
Copy link
Member

chregu commented Jan 12, 2014

It sounds like a dns timeout issue somewhere.

I just uploaded PHP 5.5.8, maybe you can test if that solves the problem

@huckeduster
Copy link
Author

Just tried 5.5.8. Still the same, 5 seconds delay, going to try this on another mac this week too.

@anthonybrown
Copy link

Working good for me

`PHP 5.5.8 (cli) (built: Jan 12 2014 18:50:29)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

real 0m0.378s
user 0m0.034s
sys 0m0.022s`

@huckeduster
Copy link
Author

On another Mac (10.9, almost vanilla install) there are no problems. So I guess it's an issue with my development machine.

@antonmedv
Copy link

I got same issue with php 5.5.8.

@ondrejmirtes
Copy link

Same issue here with PHP 5.5.9.

@chregu
Copy link
Member

chregu commented Aug 7, 2014

just installed 5.5.14 on a brand new machine (with 10.9), works fine works me

@zsalab
Copy link

zsalab commented Aug 8, 2014

It's really slow for me:
time /usr/local/php5/bin/php -v
PHP 5.5.15 (cli) (built: Aug 6 2014 18:11:54)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

real 0m30.050s
user 0m0.019s
sys 0m0.012s

@chregu
Copy link
Member

chregu commented Aug 8, 2014

Still can't reproduce it.

@ondrejmirtes
Copy link

I solved this issue in Homebrew version by recompiling PHP without the IMAP extension (by not using the --with-imap option)

@chregu
Copy link
Member

chregu commented Aug 9, 2014

I managed to build the imap extension as shared extension now. It's already available for PHP 5.4 and OS X 10.8/9, maybe you could try this version, remove /usr/local/php5/php.d/50-extension-imap.ini and see if this helps.

Other builds will soon follow.

@chregu
Copy link
Member

chregu commented Aug 9, 2014

the imap extension is now a shared extension in all builds. Download and disable it and see, if this helps

@zsalab
Copy link

zsalab commented Aug 9, 2014

yes, without the imap module it's working fine....

@chregu
Copy link
Member

chregu commented Aug 24, 2014

so, it's some dns lookup thingie or something similar. Closing this, please open a new bug, if that's a real issue for you and just disabling imap doesn't solve your problem (but googling didn't bring me an easy solution)

@chregu chregu closed this as completed Aug 24, 2014
@jaznow
Copy link

jaznow commented Dec 17, 2014

I have had same problem with MAMP, php 5.5.10, 5 second delay

time php -n -d extension=imap.so -v
PHP 5.5.10 (cli) (built: Apr 10 2014 17:49:22)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

real 0m5.131s
user 0m0.020s
sys 0m0.009s

Why the simple fact of loading the library takes 5 seconds?, isn't this a bug of PHP?, I need that extension, but I have to keep it desactivated in order to save that 5 seconds every time...

@mlebkowski
Copy link

Adding your hostname to /etc/hosts worked well for me:

::1             marakei.local
127.0.0.1       marakei.local

http://serverfault.com/questions/586141/php-cli-with-imap-5-second-startup-delay

@innoscience
Copy link

Can confirm that the solution indicated by @mlebkowski worked, your machine's current hostname should be added to the hosts file. You can also append to the existing entries:

 127.0.0.1  localhost iMac.local
 ::1        localhost iMac.local

@jaznow
Copy link

jaznow commented Mar 2, 2015

Works for me too! :)

@tamhv
Copy link

tamhv commented Sep 22, 2016

Thanks @innoscience it works!

@vladprokopchuk
Copy link

vlad@MacBook-Pro-Vladimir /etc $ time php -v
PHP 7.1.6 (cli) (built: Jul 3 2017 08:34:33) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

real 0m5.039s
user 0m0.016s
sys 0m0.011s
vlad@MacBook-Pro-Vladimir /etc $

the same problem
adding 127.0.0.1 myhost.local to /etc/hosts file did not help
I installed php by homebrew and I really need IMAP extension

@MladenJanjetovic
Copy link

To find you machine's local hostname check this:
On your Mac, choose Apple menu > System Preferences, then click Sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests