1

I am trying to compile PHP myself on Mac OS X Mavericks.

Here is the configure command:

./configure --prefix=/opt/local/php --with-config-file-path=/opt/local/php/conf 
--with-apxs2=/opt/local/apache/bin/apxs --with-mysql=/opt/local/mysql 
--with-mysql-sock=/tmp --with-libedit --with-pcre-dir=/opt/local 
--enable-bcmath --enable-mbstring --enable-sockets --enable-zip --with-bz2 
--with-curl --with-jpeg-dir=/opt/local --with-png-dir=/opt/local 
--with-freetype-dir=/opt/local --with-gd=/opt/local

When I try to d sudo make, I get this error:

Undefined symbols for architecture x86_64:
 "_XpmLibraryVersion", referenced from:
   _zm_info_gd in gd.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

PHP version is 5.5.5 and libgd was compiled with this config:

./configure --prefix=/opt/local --with-png=/opt/local --with-jpeg=/opt/local 
--with-tiff=/opt/local --with-freetype=/opt/local

Without the --with-gd flag, PHP compiles just fine.

What does this error mean and how do I fix it?

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
Clickbeetle
  • 629
  • 4
  • 13

2 Answers2

2

You can pass --with-xpm-dir=no to configure which should disable xpm support, if that doesn't resolve it try installing the X11 Update for Mac OS X. And, you should probably recompile libgd after installing that update (to include libXpm)

Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249
  • Thanks for reply! I tried both options, but they didn't help, still the same problem. – Clickbeetle Nov 10 '13 at 22:08
  • Interesting. You can try recompiling http://libgd.bitbucket.org/ libgd after installing X11 (to include libXpm), but otherwise I'm baffled. – Elliott Frisch Nov 10 '13 at 22:15
  • Finally! You are the man! Problem solved. Man i love you, i spend almost half a day with this problem and i didn't think that i can just use libXpm from XQuartz. So i recompiled GD with xpm and php with xpm. Thanks. – Clickbeetle Nov 10 '13 at 23:03
0

This options help me on Debian:

--with-gd=/usr/ --with-xpm-dir=/usr/ '--with-libdir=lib/x86_64-linux-gnu'
Oleg Neumyvakin
  • 9,706
  • 3
  • 58
  • 62