In my previous post I was trying to get PHP 5.5 beta 1 compiled on my OSX laptop. It turns out that Mountain Lion ships with a version of Bison from 2006. Really Apple? There is a difference between being a hipster and being old. Let’s fix this! If you have not read it already and installed autoconf and git, make sure to do so.
Upgrading Bison:
- Go to http://ftp.gnu.org/gnu/bison/ and get 2.6.2. Why not 2.7.1? Because PHP doesn’t support it yet. You would need to manually patch Zend/acinclude.m4 to allow for it.
- tar -zxvf bison-2.7.1.tar.gz
- cd bison-2.7.1
- ./configure –prefix=/usr/local
- make
- sudo make install
- export PATH=/usr/local/bin:$PATH
Now we have a new version of bison in /usr/local/bin. Time to configure php again.
./configure --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --disable-cgi --with-curl=/usr --enable-mbstring --enable-mbregex --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock --with-libedit --with-readline=/usr --enable-shmop --with-snmp=/usr --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --with-iconv-dir=/usr --enable-zip
And it worked! Will it blend?
make ... Build complete. Don't forget to run 'make test'. $
Yes in deed. I made sure to run “make test” as well and not everything passed so I sent in the report. Make sure you do as well.
2 replies on “OSX PHP 5.5 Beta 1 Build part 2 (Bison)”
Hi Greg, today I stumbled in your blog because it’s like 2 days I’m trying to compile PHP 5.5.4 under MacOS X 10.8.5 with absolutely no luck… at all!
I need to include the intl module and it looks like this is the cause of my pain.
Every time the compilation process stops there:
/bin/sh /Users/administrator/Desktop/src/php-5.5.4/libtool –silent –preserve-dup-deps –mode=compile g++ -I/usr/local/include -Wno-write-strings -Iext/intl/ -I/Users/administrator/Desktop/src/php-5.5.4/ext/intl/ -DPHP_ATOM_INC -I/Users/administrator/Desktop/src/php-5.5.4/include -I/Users/administrator/Desktop/src/php-5.5.4/main -I/Users/administrator/Desktop/src/php-5.5.4 -I/Users/administrator/Desktop/src/php-5.5.4/ext/date/lib -I/Users/administrator/Desktop/src/php-5.5.4/ext/ereg/regex -I/usr/include/libxml2 -I/usr/local/include -I/usr/X11/include -I/usr/X11/include/freetype2 -I/usr/local/src/imap-2007f/include -I/Users/administrator/Desktop/src/php-5.5.4/ext/mbstring/oniguruma -I/Users/administrator/Desktop/src/php-5.5.4/ext/mbstring/libmbfl -I/Users/administrator/Desktop/src/php-5.5.4/ext/mbstring/libmbfl/mbfl -I/Users/administrator/Desktop/src/php-5.5.4/ext/sqlite3/libsqlite -I/Users/administrator/Desktop/src/php-5.5.4/TSRM -I/Users/administrator/Desktop/src/php-5.5.4/Zend -no-cpp-precomp -O3 -fno-common -arch x86_64 -c /Users/administrator/Desktop/src/php-5.5.4/ext/intl/intl_convertcpp.cpp -o ext/intl/intl_convertcpp.lo
In file included from /usr/include/c++/4.2.1/cwchar:52,
from /usr/include/c++/4.2.1/bits/postypes.h:46,
from /usr/include/c++/4.2.1/iosfwd:49,
from /usr/include/c++/4.2.1/bits/stl_algobase.h:70,
from /usr/include/c++/4.2.1/bits/char_traits.h:46,
from /usr/include/c++/4.2.1/string:47,
from /usr/local/include/unicode/std_string.h:30,
from /usr/local/include/unicode/unistr.h:31,
from /Users/administrator/Desktop/src/php-5.5.4/ext/intl/intl_convertcpp.h:26,
from /Users/administrator/Desktop/src/php-5.5.4/ext/intl/intl_convertcpp.cpp:21:
/usr/include/c++/4.2.1/ctime:64: error: expected constructor, destructor, or type conversion before ‘namespace’
make: *** [ext/intl/intl_convertcpp.lo] Error 1
Do you have any magic sauce to make my PHP compilation process reach an end?
Thanks for your time!
Simone
Simone:
Alas I have not tried building 5.5.4 or with INTL support. A quick google shows me that there have been other issues with intl.
I would recommend seeing if Mansion’s old post for 5.3 will work for you by building INTL as an extension instead of into the core.
BTW: I removed your website url because it was being blocked as “adult content”.