1

I'm trying to compile PHP 5.6.1 on my MacBook Pro but I can't seem to get pass all the problems.

I get stuck with the error message at make:

clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:138: recipe for target 'libs/libphp5.bundle' failed
make: *** [libs/libphp5.bundle] Error 1

I compiled the Apache v. 2.4.10 from source with configure options:

sudo ./configure --prefi=/usr/local/apache2 --enable-so --enable-modules=most

Apache is working normally.

My configure options for PHP:

sudo ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --disable-ipv6 --enable-dtrace --with-zlib --with-curl=/usr/local/cURL --enable-ftp --enable-mbstring --with-mcrypt=/usr/local/libmcrypt --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-opcache=no

I can't get pass the make process. I've tried everything: sudo make clean doesn't help. I've reinstalled Xcode and CommandLineTools. And tried everything that I could find searching the web but to no prevail.

Does anyone know why it doesn't work?

My last resort would be reinstall mavericks (if anything was overwritten or broken) but that is the last resort I want to take and start over again on a fresh copy.

Thanks for all your help.

Pending my research: PHP only throws the error when trying to configure it with mysqli.

Undefined symbols for architecture x86_64:
  "_dns_free", referenced from:
      _zif_dns_check_record in dns.o
      _zif_dns_get_record in dns.o
      _zif_dns_get_mx in dns.o
  "_dns_open", referenced from:
      _zif_dns_check_record in dns.o
      _zif_dns_get_record in dns.o
      _zif_dns_get_mx in dns.o
  "_dns_search", referenced from:
      _zif_dns_check_record in dns.o
      _zif_dns_get_record in dns.o
      _zif_dns_get_mx in dns.o
  "_res_9_dn_expand", referenced from:
      _php_parserr in dns.o
      _zif_dns_get_mx in dns.o
  "_res_9_dn_skipname", referenced from:
      _zif_dns_get_record in dns.o
      _zif_dns_get_mx in dns.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp5.bundle] Error 1

What am I missing?

3
  • That error is at the end of the build we need to know the first error. I would use a package system link macports or home-brew - or for PHP look at MAMP etc
    – mmmmmm
    Oct 5, 2014 at 14:27
  • Hi that is the only error I get at make. But I have to use opcache=no at configure or it fails because it can't link BSD architecture. I don't want to use brew or macports. Only sources.
    – nvukovic
    Oct 5, 2014 at 15:45
  • clang found an error and will have reported it in a log - without that we cannot help you (If you only want sources then you have to be able to debug this sort of issue)
    – mmmmmm
    Oct 5, 2014 at 15:53

1 Answer 1

1

Managed to find the problem.

Remove the previous installation and then:

--with-mysqli : I used the native MySql driver ( omitted the folder path )

So when you forget to add a module to your initial compilation and you are stuck with some kind a freaky error delete the old instance that successfully installed and do the ./configure ; make clean ; make ; make install just to be sure:)

Thanks goes to David Parker for helping me with the problem.

Thanks David.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .