Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I installed Ubuntu Desktop 13.10 64-bit in VMware.

I am trying to compile PHP 5.4.14 on the machine. Here's the bit where make stops due to an error:

/usr/bin/ld: ext/mysqlnd/.libs/mysqlnd_net.o: undefined reference to symbol 'uncompress'
/usr/bin/ld: note: 'uncompress' is defined in DSO /lib/x86_64-linux-gnu/ so try adding it to the linker command line
/lib/x86_64-linux-gnu/ could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

I have the same version of php compiled and built on a 12.10 32-bit VM and it seems to be working properly.

I have checked that I have zlib1g zlib1g-dev and zlibc installed. What could be the problem?

share|improve this question
You are compiling vanilla or debian package? – oerdnj Apr 26 '13 at 16:13

2 Answers 2

Anyway I would suggest to follow:

How do I install latest PHP in supported Ubuntu versions (like 5.4.x in Ubuntu 12.04)?

Compiling vanilla PHP requires you to do a little bit of patching of upstream configure script to support MultiArch libraries. You can pull the required patches from debian/patches/ directory in the Debian package.

share|improve this answer
Do I still need to patch it if I just want it to be compiled for my 64-bit version of Ubuntu? – F21 Apr 27 '13 at 3:48
If you want to use vanilla upstream PHP, then you at least need to pick up the MultiArch patch. But I still don't understand the reason why to compile your own PHP? – oerdnj Apr 27 '13 at 7:21
Mainly because I can compile the latest versions once they are released and try out beta versions. It is somewhat annoying that I need to patch it for 64-bit though. All the blog posts I have been reading just suggested --with-libdir=lib64 during configuration, but that obviously haven't been working – F21 Apr 27 '13 at 7:24
The mentioned PPA of mine is updated within the days of the PHP.NET releases. There's really no compeling reason to compile your own PHP. – oerdnj Apr 27 '13 at 7:27
Oh, and also as a learning exercise :) I won't be compiling my own in production, but it's always interesting to learn something new by compiling my own on a dev box :) – F21 Apr 27 '13 at 7:31

--with-libdir=lib64 should do the trick. I think you forgot to do a make clean after adding the --with-libdir configuring and prior to make compile . I've just compiled php version 5.5.2 using phpfarm and initially encountered the same issue described by you when using --with-mysqli=mysqlnd. Adding --with-libdir=lib64 AND make clean fixed the issue.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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