PHP CLI horribly broken on OS X

General discussion for the Zend Server CE

PHP CLI horribly broken on OS X

Postby coolbru on Fri Mar 06, 2009 12:26 pm

If I try to run the PHP CLI program, I get this:
Code: Select all
/Applications/ZendServer/bin/php -v
dyld: Library not loaded: /usr/local/postgresql-8.2.3/lib/libpq.5.dylib
  Referenced from: /Applications/ZendServer/bin/php
  Reason: image not found

It should be loading it from /Applications/ZendServer/lib/libpq.5.dylib, but it's clearly looking in the wrong place. I fixed that and got all these (one at a time, just to be really tedious!):
Code: Select all
dyld: Library not loaded: /usr/local/zend/lib/mysql/libmysqlclient.15.dylib
  Referenced from: /Applications/ZendServer/bin/php

dyld: Library not loaded: /usr/local/Zend/Core/lib/libssl.0.9.8.dylib
  Referenced from: /Applications/ZendServer/lib/php_extensions/curl.so

dyld: Library not loaded: /usr/local/Zend/Core/lib/libcrypto.0.9.8.dylib
  Referenced from: /Applications/ZendServer/lib/php_extensions/curl.so

dyld: Library not loaded: /usr/local/openssl-0.9.8i/lib/libcrypto.0.9.8.dylib
  Referenced from: /Applications/ZendServer/lib/php_extensions/imap.so

dyld: Library not loaded: /usr/local/Zend/Core/lib/libpng.3.dylib
  Referenced from: /Applications/ZendServer/lib/php_extensions/gd.so

dyld: Library not loaded: /usr/local/zend/lib/libmcrypt.4.dylib
  Referenced from: /Applications/ZendServer/lib/php_extensions/mcrypt.so

dyld: Library not loaded: libicui18n.dylib.36
  Referenced from: /Applications/ZendServer/lib/php_extensions/intl.so

dyld: Library not loaded: libicuuc.dylib.36
  Referenced from: /Applications/ZendServer/lib/php_extensions/intl.so

dyld: Library not loaded: libicudata.dylib.36
  Referenced from: /Applications/ZendServer/lib/php_extensions/intl.so

dyld: Library not loaded: libicuio.dylib.36
  Referenced from: /Applications/ZendServer/lib/php_extensions/intl.so

dyld: Library not loaded: /usr/local/imagick/lib/libMagickWand.1.dylib
  Referenced from: /Applications/ZendServer/lib/php_extensions/imagick.so

This is just a total mess! It's looking in different places for the same lib, has paths that are ambiguous on a case-insensitive FS (i.e. HFS), expects libs to be in the default path. Of course it will all work fine on a build machine that has these libraries installed in those locations, but even the most trivial testing would have spotted this. I worked around these with a bit of judicious copying and symlinking and finally got it working. Please can you build the PHP binary with the right paths?
coolbru
 
Posts: 10
Joined: Fri Mar 06, 2009 11:29 am

Re: PHP CLI horribly broken on OS X

Postby zend_amir on Sun Mar 08, 2009 5:52 pm

Please source /etc/zce.rc before running php cli scripts.
Code: Select all
. /etc/zce.rc

This should solve such problems. Another option is to use the wrapper php-cli in the bin directory.
Please tell me if it solves the problem.

Amir
User avatar
zend_amir
 
Posts: 55
Joined: Thu Jan 22, 2009 4:27 pm

Re: PHP CLI horribly broken on OS X

Postby coolbru on Sun Mar 08, 2009 9:51 pm

OK, that works, thanks. I added it to my global zshrc. Would be good to have this in the installation instructions. That said, why not build the plain php binary with the right paths in the first place? Seems a bit silly to need the wrapper since pretty much every php cli script in existence will be expecting it to be called plain 'php'. Perhaps reverse the roles - make 'php-cli' the binary and 'php' the wrapper?
coolbru
 
Posts: 10
Joined: Fri Mar 06, 2009 11:29 am

Re: PHP CLI horribly broken on OS X

Postby zend_amir on Sun Mar 15, 2009 4:59 pm

Thanks for the feedback, we will consider both suggestions.
We originally tried do it your way - php as the wrapper and php-cli as the binary but then we found that sometimes it break other wrappers. So for example phpunit cannot run if the php is a wrapper.
User avatar
zend_amir
 
Posts: 55
Joined: Thu Jan 22, 2009 4:27 pm

Re: PHP CLI horribly broken on OS X

Postby coolbru on Mon Mar 16, 2009 2:57 pm

I've run into a problem with the zce.rc setup script - because it pollutes the environment by setting DYLD_LIBRARY_PATH, it tends to break lots of other things, for example MacPorts and source builds of anything that shares components with php - in fact it was also responsible for breaking the pecl mysql extension build I was trying to do. Seems like this would be unnecessary if the paths were right in the first place! For now I've removed that part of the zce.rc file so that my other software works.
coolbru
 
Posts: 10
Joined: Fri Mar 06, 2009 11:29 am

Re: PHP CLI horribly broken on OS X

Postby jess04 on Wed Mar 25, 2009 12:25 am

Hello,

The version that is currently tested by QA no longer requires exporting the DYLD_LIBRARY_PATH, all PHP extensions are built so that LD [Dynamic linker] will search for their dependencies under /usr/local/zend/lib by default, this is also where the installation will place them. It will also include a bundled MySQL server [version 5.1.31] and phpMyAdmin [version 3.1.3].
This version should be released shortly.

Looking forward to your feedback, thanks,
May the source be with you,

Jess Portnoy
jess04
 
Posts: 628
Joined: Thu Jan 15, 2009 3:37 pm

Re: PHP CLI horribly broken on OS X

Postby coolbru on Wed Mar 25, 2009 12:09 pm

That's great news, I'll look forward to it.
coolbru
 
Posts: 10
Joined: Fri Mar 06, 2009 11:29 am

Re: PHP CLI horribly broken on OS X

Postby jess04 on Tue Apr 07, 2009 12:02 pm

Hello all,

There's a new MAC package that contains what I've detailed in my last reply to this post.
I would highly appreciate it if you could test it and provide feedback.
The package is available from: http://www.zend.com/products/server/downloads-all

IMPORTANT: One small note, before installing the new package, please follow the removal procedure as stated in:
viewtopic.php?f=44&t=376
This is a one time deal, the next release will be upgradable from this one.

Thanks in advance,
May the source be with you,

Jess Portnoy
jess04
 
Posts: 628
Joined: Thu Jan 15, 2009 3:37 pm


Return to Zend Server Community Edition

Who is online

Users browsing this forum: No registered users and 1 guest