6

I am trying to compile php from source on mac with the bzip2 extension and I keep getting an error saying

checking for BZip2 in default path... not found

I've tried setting the LDFLAGS and CPPFLAGS but that doesn't seem to work.

The dylib is in /usr/local/opt/bzip2/lib and the header files are in usr/local/opt/bzip2/include.

Senuri Ruhunuge
  • 72
  • 1
  • 1
  • 11
kellum42
  • 61
  • 1
  • 3

3 Answers3

4

I had the exact same issue. I resolved it by installing bzip2 by using brew.

brew install bzip2

Sylvester Loreto
  • 404
  • 6
  • 18
4

Install dependencies for php

sudo apt-get install -y libbz2-dev sqlite3 libsqlite3-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libonig-dev libreadline-dev libtidy-dev libxslt-dev libzip-dev
Thomas Zhang
  • 101
  • 3
3

This also works:

sudo apt-get install libbz2-dev
T.Todua
  • 53,146
  • 19
  • 236
  • 237