Opened 12 years ago

Last modified 12 years ago

#35222 new defect

php-imap causes cli to take 35 seconds to initialize

Reported by: localgod@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: Cc: jyrkiwahlstedt
Port: php5-imap php53-imap php54-imap

Description

After I updated macports a few days ago my php cli has become horribly slow:

$ time /opt/local/bin/php --version
PHP 5.3.12 with Suhosin-Patch (cli) (built: Jul 16 2012 15:19:53) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans
    with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH

real	0m35.056s
user	0m0.032s
sys	0m0.018s

When I run the osx supplied version:

$ time /usr/bin/php --version
PHP 5.3.10 with Suhosin-Patch (cli) (built: Feb 20 2012 22:55:53) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

real	0m0.598s
user	0m0.048s
sys	0m0.128s

I tried uninstalling all php related ports and do a fresh install with the following ports:

php5 +apache2 +pear +suhosin 
ZendFramework
php5-solr
php5-gearman
php5-http
php5-imagick
php5-mongo
php5-redis
php5-suhosin
php5-xdebug

...but the problem persists.

I have another machine without php5-gearman, php5-http, php5-imagick, php5-mongo, php5-redis and php5-suhosin installed that works fine, so I tried uninstalling these, but this has no effect, cli is still extremely slow.

Running php scripts thru apache works fine.

Im running Xcode Version 4.3.2 on OSX 10.7.4

Change History (9)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…

I've never seen this problem before so I'm not sure what to suggest. Try the php54 or php53 ports which are newer. If that doesn't help, deactivate all PHP extension ports. Does the problem persist? If not, reactivate them one at a time until the problem returns; then you'll know the culprit and whom to report the problem to.

comment:2 Changed 12 years ago by localgod@…

I tried uninstalling macports all together and start from scratch with an updated xcode (4.3.3).

This did not help.

I then uninstall all php5 related ports and install the following ports one by one:

php54
php54-solr
php54-http
php54-imagick
php54-mongo
php54-redis
php54-xdebug
php54-SPL_Types
php54-apc
php54-calendar
php54-curl
php54-dba
php54-exif
php54-ftp
php54-gd
php54-gettext
php54-gmp
php54-iconv
php54-mbstring
php54-mcrypt
php54-memcache
php54-mssql
php54-mysql
php54-odbc
php54-openssl
php54-pcntl
php54-posix
php54-postgresql
php54-soap
php54-sockets
php54-sqlite
php54-tidy
php54-wddx
php54-xmlrpc
php54-xsl
php54-zip
php54-imap
php54-gearman

This went well until I came to the last two ports (imap, gearman). German fails to install at all, and imap seems to be the cause of the slow cli.

Without imap

$ time php54 --version
PHP 5.4.4 (cli) (built: Jun 16 2012 12:49:38) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

real	0m0.046s
user	0m0.024s
sys	0m0.015s

with imap

time php54 --version
PHP 5.4.4 (cli) (built: Jun 16 2012 12:49:38) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

real	0m35.053s
user	0m0.029s
sys	0m0.018s

gearman fails when trying to install gearmand:

...
:info:configure checking for boost/thread.hpp... yes
:info:configure checking for the Boost thread library... no
:info:configure configure: error: cannot find the flags to link with Boost thread
:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_gearmand/gearmand/work/gearmand-0.33" && ./configure --prefix=/opt/local --mandir=/opt/local/share/man --with-libevent-prefix=/opt/local --disable-libdrizzle --disable-libpq --disable-libmemcached --disable-libtokyocabinet
:info:configure Exit code: 1
:error:configure org.macports.configure for port gearmand returned: configure failure: command execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
    while executing
"$procedure $targetname"
:info:configure Warning: targets not executed for gearmand: org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
:error:configure Failed to install gearmand
:debug:configure couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory
    while executing
"open [file join $dir tclIndex]"
...

How do I install PEAR using macports? php54 don't have a pear variant flag. The same goeas for apache2 support. There is no apache2 variant.

comment:3 in reply to:  2 ; Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Port: php-imap added; php5 removed
Summary: php5 5.3.12 horrible slow cliphp-imap causes cli to take 35 seconds to initialize

Replying to localgod@…:

German fails to install at all,

Please file a separate ticket about this.

and imap seems to be the cause of the slow cli.

Interesting. I'm not able to reproduce that problem on my system. I'm using Snow Leopard however. You could try recompiling php54-imap with a different compiler; perhaps compiling with Xcode 4.3's default clang compiler causes problems for imap. For example, try llvm-gcc-4.2 instead:

sudo port -f uninstall php54-imap
sudo port install php54-imap configure.compiler=llvm-gcc-4.2

Or perhaps a better question to ask first: are you actually using php-imap for something? Have you configured any imap-specific values in your php.ini that might account for the slowdown? Or is there an auto_prepend_file that's using imap (slowly) when it's available? Perhaps something is configured to use a server that cannot be reached?

How do I install PEAR using macports? php54 don't have a pear variant flag.

It's a separate port now:

sudo port install php54-pear

Note however that everything that's in PEAR is in MacPorts, and we recommend you install such items using MacPorts instead of using PEAR separately. You can see them all by typing:

port search pear-

The same goeas for apache2 support. There is no apache2 variant.

Also a separate port:

sudo port install php54-apache2handler

comment:4 in reply to:  3 ; Changed 12 years ago by localgod@…

Replying to ryandesign@…:

Please file a separate ticket about this.

Done! #35224

Or perhaps a better question to ask first: are you actually using php-imap for something?

I don't really need imap, but I used to have zendframwork installed which depended on it. But there don't seem to be a zendframwork port there is php54 compliant so its not interesting for now anyway.

How do I install PEAR using macports? php54 don't have a pear variant flag.

It's a separate port now:

sudo port install php54-pear

The install seems to have gone fine but I don't seem to have a pear command in my terminal?!

The same goeas for apache2 support. There is no apache2 variant.

Also a separate port:

I have a working apache setup now, thanks

comment:5 in reply to:  4 ; Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to localgod@…:

I don't really need imap, but I used to have zendframwork installed which depended on it. But there don't seem to be a zendframwork port there is php54 compliant so its not interesting for now anyway.

Yes, ZendFramework, and most other PHP-using ports, still need to have php5, php53 and php54 variants added to let the user choose. Feel free to file tickets about the ones you need so their maintainers can begin working on that.

sudo port install php54-pear

The install seems to have gone fine but I don't seem to have a pear command in my terminal?!

Ah you seem to be right. I have not used PEAR in a long time and handed this portion of PHP over to Bradley Giesbrecht. I think I remember hearing that the php54-pear port just lets the other separate PEAR module ports work correctly. So the answer is: don't use pear manually; instead, install the ports for the specific PEAR modules that you want.

comment:6 in reply to:  5 Changed 12 years ago by localgod@…

Replying to ryandesign@…:

Yes, ZendFramework, and most other PHP-using ports, still need to have php5, php53 and php54 variants added to let the user choose. Feel free to file tickets about the ones you need so their maintainers can begin working on that.

I have created a ticket with a request for that. (#35227)

sudo port install php54-pear

The install seems to have gone fine but I don't seem to have a pear command in my terminal?!

Ah you seem to be right. I have not used PEAR in a long time and handed this portion of PHP over to Bradley Giesbrecht. I think I remember hearing that the php54-pear port just lets the other separate PEAR module ports work correctly. So the answer is: don't use pear manually; instead, install the ports for the specific PEAR modules that you want.

Running:

sudo port install php54-pear
sudo port install pear-PHP_CodeSniffer

Should allow me to run the phpcs command in my terminal. This dos not seem to be the case...even after a source ~/.bash_profile

Am I missing something?

comment:7 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

According to "port contents pear-PHP_CodeSniffer", it has installed /opt/local/lib/php/pear/bin/phpcs. If you think it should be installed somewhere else, please file a ticket about that.

comment:8 Changed 12 years ago by localgod@…

I uninstalled all macports pear related ports and installed pear manually.

cd #
curl http://pear.php.net/go-pear.phar -o go-pear.phar
sudo php go-pear.phar

I modified the PEAR install process to fit php54 to the following:

1. Installation base ($prefix) : /opt/local/lib/php54
...
4. Binaries directory          : /opt/local/bin
...

This seem to work without any problems and I have access to pear packages not available thru macports like phploc.

As the zendframwork and gearmand problem have been created as separate tickets, I think it is ok to close this one.

comment:9 Changed 12 years ago by jmroot (Joshua Root)

Cc: jwa@… added
Port: php5-imap php53-imap php54-imap added; php-imap removed
Note: See TracTickets for help on using tickets.