Skip to content

Instantly share code, notes, and snippets.

@anunay
Last active July 16, 2021 10:52
Show Gist options
  • Select an option

  • Save anunay/7698181 to your computer and use it in GitHub Desktop.

Select an option

Save anunay/7698181 to your computer and use it in GitHub Desktop.
Installing AutoConf and Fixing Phpize on OSX 10.9
Installing AutoConf and Fixing Phpize on OSX 10.9
@anunay
Copy link
Copy Markdown
Author

anunay commented Nov 28, 2013

Installing AutoConf and Fixing Phpize on OSX 10.9

When setting up my development environment on my new Mac (running OSX 10.8) I noticed autoconf was missing. Autoconf is used by phpize to compile php extensions like xdebug and is something I use on a reasonably frequent basis.

The error I got when trying to run php on the xdebug extension was:

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

ERROR: `phpize’ failed

When running previous versions of OSX autoconf has either been included (<10.6) or available by installing xcode and the development command line tools. However after installing the latest version of xcode (4.3) I found autoconf absent from there as well!

The solution I came up with was to compile autoconf from source and set the environment variable which points to autoconf required by phpize.

Download autoconf
curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz

Untar the autoconf archive
tar -xvzf autoconf.tar.gz

Configure and make – note the folder un-archived may have a different name.
cd autoconf-2.69
./configure
sudo make && sudo make install

This installs autoconf to ‘/usr/local/bin/autoconf’. In order to get phpize to work set the PHP_AUTOCONF environment variable to point to the newly installed autoconf.

export PHP_AUTOCONF=/usr/local/bin/autoconf

Running phpize when attempting to compile a php extension should now work.

@danieljordi
Copy link
Copy Markdown

thanks for this. might want to rename your topic from phpsize to phpize.

@fruityfred
Copy link
Copy Markdown

Thank you very much!

@kaiye
Copy link
Copy Markdown

kaiye commented Mar 19, 2015

thanks , it helped me install php redis extension for ampps ~

@elazafranjusticiero
Copy link
Copy Markdown

thanksss!!!

@bsgreenb
Copy link
Copy Markdown

Most helpful result I found

@irishIwasDrinking
Copy link
Copy Markdown

Nice, worked great.

@seromenho
Copy link
Copy Markdown

Thank you!

@jerrylau91
Copy link
Copy Markdown

Thanks so much! Help a lot when I install my php redis extension.

@doertydoerk
Copy link
Copy Markdown

Thanks, mate. Very helpful!

Copy link
Copy Markdown

ghost commented Jan 7, 2016

-bash: autoconf.tar.gz: Permission denied :(

@JavierCabezas
Copy link
Copy Markdown

This really helped me out, thanks!

@philhamble
Copy link
Copy Markdown

Brilliant - worked for me on El Capitan. Thanks.

@moo-im-a-cow
Copy link
Copy Markdown

quicker way of doing this: (using homebrew)
brew install autoconf
if you dont have homebrew, i strongly recomend getting it from http://brew.sh/

@nandakumardevadas
Copy link
Copy Markdown

Great. Life saver.

@Press4Ward
Copy link
Copy Markdown

I'm new to this field and this was definitely helpful to me. Thanks so much!!!

@shirakaba
Copy link
Copy Markdown

Note: even if you are using brew install autoconf, you will still need to manually export the $PHP_AUTOCONF environment variable, using: export PHP_AUTOCONF=/usr/local/bin/autoconf.

@ztz12
Copy link
Copy Markdown

ztz12 commented Jul 9, 2019

thank you very match

@anunay
Copy link
Copy Markdown
Author

anunay commented Jul 9, 2019

thanks for this. might want to rename your topic from phpsize to phpize.

Good catch, I did that :)

@StefanXiepj
Copy link
Copy Markdown

Cool, thank you very much, most helpful result i foud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment