Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to compile php 5.4.7 on mac osx 10.6.8.

I could install it using the default procedure:

./configure \
--prefix=/usr/local \
--with-config-file-path=/usr/local/etc \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql


sudo make clean
sudo make
sudo make install

But now if I try to install to compile php with the curl module it fails:

./configure \
--prefix=/usr/local \
--with-config-file-path=/usr/local/etc \
--with-curl=/usr \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql


sudo make clean
sudo make

Last lines of make output:

Undefined symbols:
  "_CRYPTO_set_locking_callback", referenced from:
      _zm_shutdown_curl in interface.o
      _zm_startup_curl in interface.o
  "_CRYPTO_num_locks", referenced from:
      _zm_shutdown_curl in interface.o
      _zm_startup_curl in interface.o
  "_CRYPTO_get_id_callback", referenced from:
      _zm_startup_curl in interface.o
  "_CRYPTO_set_id_callback", referenced from:
      _zm_shutdown_curl in interface.o
      _zm_startup_curl in interface.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1

I read somewhere that in this case, I should tell the compiler where to find the missing library, so that it can links the missing files.

The problem is that I don't what library I should look for, is it libssl2 ?

share|improve this question

closed as off topic by Michael Hampton, Adrian, rnxrx, John Gardeniers, EightBitTony Oct 20 '12 at 18:40

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

I had the same issue with & . Both libraries where installed under /usr/local, but ld could never find the symbols. I was able to fix this on OSX 10.6.8 by compiling them as shared libraries. You can do this by adding shared to out --with-curl flag.

./configure \
  --prefix=/usr/local \
  --with-config-file-path=/usr/local/etc \
  --with-curl=shared,/usr \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --with-mysql

If this doesn't work, try installing the latest curl under /usr/local, and updating the config flag.

--with-curl=shared,/usr/local
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.