PHP6 trunk installation on FreeBSD 8.1

On http://snaps.php.net/ you can already download the really latest dev version of php. So I decided to use the PHP 5.3.99-dev aka PHP6.

The installation as Apache modules works this way:

./configure --prefix=/usr/local/php6 --with-apxs2=/usr/local/httpd/bin/apxs --disable-cli --disable-cgi --with-config-file-path=/etc/php6 --disable-ipv6 --disable-short-tags --with-openssl=/usr --with-pcre-regex --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-libxml-dir --enable-exif --disable-filter --enable-ftp --with-openssl-dir=/usr --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-gettext --with-mhash --enable-intl --with-mcrypt --with-mssql=/usr/local --with-mysql --with-zlib-dir=/usr --with-mysqli --with-pdo-dblib --with-pdo-mysql --with-mm --enable-shmop --with-libxml-dir=/usr --enable-soap --with-libxml-dir=/usr --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-xmlrpc=/usr/local --with-xsl=/usr/local --enable-zip --with-pear --enable-maintainer-zts --with-tsrm-pthreads --enable-static --with-icu-dir=/usr/local

Make sure you have installed ICU (http://site.icu-project.org/) or (/usr/ports/devel/icu4) or otherwise you’ll get this error:

configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.”

libmm also needed: http://www.ossp.org/pkg/lib/mm/

Now running “make” and result:

In file included from /home/sources/php-trunk-201009180230/ext/mysqli/php_mysqli_structs.h:63,
from /home/sources/php-trunk-201009180230/ext/mysqli/mysqli.c:33:
/usr/local/include/mysql/my_global.h:626:25: error: my_compiler.h: No such file or directory
In file included from /home/sources/php-trunk-201009180230/ext/mysqli/mysqli.c:34:
/home/sources/php-trunk-201009180230/ext/mysqli/mysqli_priv.h:312:27: warning: no newline at end of file
*** Error code 1

My installed mysql version in /usr/local: mysql-5.1.50
Seems to be a very new bug, need to update mysql. Getting Snapshot from http://labs.mysql.com/ the source file: mysql-5.1.52-snapshot20100914.tar.gz

Remember I have the mysql server in the Debian box and need here just the client:
./configure --prefix=/usr/local --enable-shared --enable-static --enable-assembler --with-zlib-dir=/usr --without-debug --with-ssl=/usr --without-docs --without-server && make && make install

Now running configure and make on PHP again:
./configure --prefix=/usr/local/php6 --with-apxs2=/usr/local/httpd/bin/apxs --disable-cli --disable-cgi --with-config-file-path=/etc/php6 --disable-ipv6 --disable-short-tags --with-openssl=/usr --with-pcre-regex --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-libxml-dir --enable-exif --disable-filter --enable-ftp --with-openssl-dir=/usr --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-gettext --with-mhash --enable-intl --with-mcrypt --with-mssql=/usr/local --with-mysql=/usr/bin/mysql_config --with-zlib-dir=/usr --with-mysqli=mysqlnd --with-pdo-dblib --with-pdo-mysql=mysqlnd --with-mm --enable-shmop --with-libxml-dir=/usr --enable-soap --with-libxml-dir=/usr --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-xmlrpc=/usr/local --with-xsl=/usr/local --enable-zip --with-pear --enable-maintainer-zts --with-tsrm-pthreads --enable-static --with-icu-dir=/usr/local

Result:

/home/sources/php-trunk-201009180230/ext/session/mod_mm.c:37:3: error: #error mm is not thread-safe
*** Error code 1

Ok, recompiling Apache: http://php.net/manual/en/install.unix.apache2.php this may take a while …

This is Apache 2.2 configure:

./configure --prefix=/usr/local/httpd --with-z=/usr --with-ssl=/usr --enable-ssl --enable-rewrite=shared --disable-userdir --enable-vhost-alias=shared --enable-dir=shared --enable-http --enable-static-ab --enable-authn-dbd=shared --datadir=/home/www --with-included-apr --enable-autoindex=shared --disable-include --enable-deflate=shared --enable-info=shared --enable-log-config --with-mpm=prefork --enable-so

and removed –enable-maintainer-zts –with-tsrm-pthreads from PHP configure.

Result:

/usr/bin/ld: cannot find -lxmlrpc
*** Error code 1

Ok, reinstallation of libiconv, expat and libxml … *arg*

../src/.libs/libxmlrpc-epi.so: undefined reference to `libiconv_open'
../src/.libs/libxmlrpc-epi.so: undefined reference to `libiconv_close'
../src/.libs/libxmlrpc-epi.so: undefined reference to `libiconv'
*** Error code 1

Stop in /home/sources/xmlrpc/sample.
*** Error code 1

Won’t work … I have to remove xmlrpc and figure out why this error happen…. I’ve read something of reinstallation of glibc … that’s strange.
Build complete.
Don't forget to run 'make test'. (Only when compiled with cli/cgi)

Installed and integrated php into Apache.

Here we are:

php6

Final PHP6 configure command:
./configure --prefix=/usr/local/php6 --with-apxs2=/usr/local/httpd/bin/apxs --disable-cli --disable-cgi --with-config-file-path=/etc/php6 --disable-ipv6 --disable-short-tags --with-openssl=/usr --with-pcre-regex --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-libxml-dir --enable-exif --disable-filter --enable-ftp --with-openssl-dir=/usr --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-gettext --with-mhash --enable-intl --with-mcrypt --with-mssql=/usr/local --with-mysql=/usr/bin/mysql_config --with-zlib-dir=/usr --with-mysqli=mysqlnd --with-pdo-dblib --with-pdo-mysql=mysqlnd --with-mm --enable-shmop --with-libxml-dir=/usr --enable-soap --with-libxml-dir=/usr --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-xsl=/usr/local --enable-zip --with-pear --enable-static --with-iconv --enable-dbase --enable-pcntl --with-pdo_sqlite --with-pspell --enable-sockets --with-icu-dir=/usr/local && make

Apache/2.2.16 (Unix) PHP/5.3.99-dev mod_ssl/2.2.16 OpenSSL/1.0.0a

Explore posts in the same categories: Programming

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.