Can't compile PHP 5.6.1 from source

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

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?

profilepic.png
manpreet 2 years ago

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.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.