$PHP_AUTOCONF errors on mac os x 10.7.3 when trying to install pecl extensions
Asked Answered
K

6

110

I am trying to setup my machine with pecl_http and memcache and in both cases, I get similar errors. This is on MAC OS X 10.7.3 (lion) and I also have XCODE installed on it. I also installed Zend Server community edition before running these commands and have CFLAGS='-arch i386 -arch x86_64' environment variables set. So please help with what I need to do

bash-3.2# **sudo pecl install pecl_http-1.7.1**
downloading pecl_http-1.7.1.tgz ...
Starting to download pecl_http-1.7.1.tgz (174,098 bytes)
.....................................done: 174,098 bytes
71 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: `phpize' failed
Kopple answered 17/2, 2012 at 4:6 Comment(6)
did you try export PHP_AUTOCONF=/usr/bin/autoconf before running the command? Of course assuming $PHP_AUTOCONF is supposed to be a localtion for the autoconf binary it should have been found, but maybe it just needs a little help :-)Viridi
@Viridi there is no /usr/bin/autoconf in that path. You think that could be the reason why?. How do I install autoconf then ? thanks.Kopple
Yeah youll need autoconf then. Thats, wierd I have it on both my 10.7 and my 10.6 box. Youll have to download and build it manually i think. Or you could jsut take the easy way out and use Macports, Homebrew, or Fink.Viridi
I have tried getting homebrew and ports but still didn't help. Then I tried downgrading from XCODE 4.3 TO 4.2.1 and everything works great from then on. No errors anymore :). I updated my answerKopple
I upgraded XCode and I had the same issue till I added /Developer/usr/bin/ to $PATH.Vaporing
Since this is tagged autoconf, it really deserves a remark that this installation process is completely opposed to the philosophy and indeed the point of autoconf. Any installation process that requires the installer to run autoconf is completely broken. The whole point of autoconf is to allow the developer to create a tarball that can be used to build the project without needing to have autoconf on the target system. It saddens me that this has become so commonplace. If you require your user to install autoconf, your distribution is broken!Handbag
D
319
brew install autoconf

Much easier solution

Devisable answered 2/3, 2012 at 2:29 Comment(9)
'sudo brew install autoconf' otherwise won't be linked because you have no permissions and this can look like it's not working.Papule
You aren't supposed to sudo brew install anything. In fact I think it fails these days.Devisable
If you don't have installed brew you can do it from here brew.sh/index_es.htmlMultiplicand
I also had the same problem as @krishna. I did it like you said, suing brew and I also created a variable export PHP_AUTOCONF=/usr/bin/autoconf to be sure and it worked fine. Just edited the php.ini adding a extension=apcu.so on the end.Nickelic
then "brew link autoconf" to make it available to the os and phpize.Supreme
It works but need to get ownership of /usr/local/Cellar first: #4804669Melt
for using BREW on mac, run this : /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Jerroldjerroll
Working on 10.12.5Nahshu
Nowadays, Homebrew installs to usr/local/bin rather than usr/bin, so you may need to export the $PHP_AUTOCONF environment variable to this newer directory: export PHP_AUTOCONF=/usr/local/bin/autoconf rather than the one mentioned by @JoabMendes. To confirm which one you need, just run which autoconf after installing it.Velazquez
G
93

You need to install autoconfig. I usually like to install libraries from source. So you can do the following:

curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
tar xzf autoconf-latest.tar.gz
cd autoconf-*
./configure --prefix=/usr/local
make
sudo make install

I just went through this with Mountain Lion.

Genocide answered 8/9, 2012 at 18:7 Comment(12)
For those dopes - LIKE ME! - who are new to Mac-World - make sure you do the above in the /usr/bin/ folder.Pyrometer
This does NOT have to be made inside the /usr/bin folder. If you understand the commands given you will notice that you are downloading some files (curl), decompressing them (tar) configuring the installation to your machine needs (./configure), compiling it (make) and installing the library (make install). The installation should take care copying files wherever they need to be. However, it is very important that you "sudo" the last command so you get the permissions you need to copy those files.Genocide
Valid points Ares, I'm not sure tho - as I was already logged-in via Terminal as 'su'... and its till wasn't able do find the files as it built the folder in root which is where I was at the time (as i too would typ. think the same - when copying files, etc..) (i'm SURE i did something wrong - just don't know what it was... but moving to /usr/bin/ and then doing the SAME - made all the diff.)Pyrometer
Great snippet Ares! If you want to always use the latest build try these modifications - Change any reference to autoconf-2.68... to just autoconf-*Tlemcen
@Kevin, So, using the wildcard will automatically select the "higher" version? I've learned something today!Genocide
@Ares, I forgot to mention the curl url will have to point to the latest build http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz. Using the wildcard in the commands is similar to hitting the tab key for autocomplete. With the * the script will autocomplete the tar -latest.tar.gz . Then autocomplete to cd in to the -2.69 (or whatever the current number is).Tlemcen
I am getting this GNU M4 1.4.6 or later is required; 1.4.14 is recommended?Nefertiti
@KevinM I have updated the answer to reflect your comment. Thanks.Genocide
@Genocide Link to the tar file is dead.Skirting
@KristenWaiteJukowski This should work regardless of the OS version. :)Genocide
I spent longer than i'd care to admit on figuring this out. You saved the day. This works on 10.12.x tooProp
I'm getting the following error: curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz curl: (7) Failed to connect to mirror.rasanegar.com port 80: Operation timed outEmbowel
A
55

On Mac OS X 10.8 situation is slightly different. Highly voted solution from Bob Spryn doesn't work, because it doesn't create symlinks, so after installing autoconf you should make them:

sudo ln -s /usr/local/Cellar/autoconf/2.69/bin/autoconf /usr/bin/autoconf
sudo ln -s /usr/local/Cellar/autoconf/2.69/bin/autoheader /usr/bin/autoheader

I know that this question was for 10.7, but I hope my answer is useful for someone on 10.8. :)

Updated: Also works on 10.10 Yosemite.

Apologist answered 1/4, 2013 at 15:53 Comment(5)
Thanks for this @anton-babenko, it worked fine for me after installing autoconf with homebrew.Ellswerth
This one fixes for a upgraded osx where autoconf and brew was previously installed.Alsatian
Worked for me on YosemiteWhitehead
Getting the following error on El Capitan: sudo ln -s /usr/local/Cellar/autoconf/2.69/bin/autoconf /usr/bin/autoconf ln: /usr/bin/autoconf: Operation not permitted. Any idea?Trunkfish
Worked for me on 10.14Carisa
A
15

or

sudo port install autoconf

if you use macports

Augustin answered 10/5, 2012 at 13:39 Comment(0)
K
4

XCODE 4.3 doesn't put all the autoconf etc. tools in the Developer folder. It doesn't even create that folder in MACINTOSH HD. I had to downgrade to XCODE 4.2.1 which installs everything you need in the Developer folder and now I see no errors.

Also here is a useful reference.

Kopple answered 17/2, 2012 at 20:34 Comment(0)
R
0

maybe you need link autoconf with brew link autoconf.

Rocray answered 15/8, 2016 at 8:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.