PHP 5.3.5 mit Mcrypt sowie Freetype in GD

Posted by Frank | Posted in 10.6, LAMP, OSX, PHP, Server | Posted on

0

Naja mal wieder bissl rumgebastelt … nachdem mit XAMPP übelst auf den nerv ging hab ich mal den nativen php Support von Mac ausgegraben. Unter 10.6.6 ist ja ehh schon php 5.3.3 dabei was ich recht überraschend fand, aber leider viel dann auf dass die mcrypt extension fehlte und kein freetype support in der gd extension drin war… Nach bissl rumsuchen und fummeln hab ich’s dann recht easy zum laufen gebracht. Um mir anderen das Leben zu erleichtern sollte ich das ganze nochmal brauchen hier nen kleines Howto!

Zunächst erstmal alle Sourcen besorgen die nötig sind.

Mac OS X Install DVD -> Xcode und Devtools installieren dabei den X11 Support nicht vergessen sonst giebts später Probs.

libjpeg

libpng

libmcrypt (nicht mcrypt sonder LIBMCRYPT!!!)

pcre

php

die ganzen Sourcen in ein Verzeichnis der Wahl entpacken, bei mir war das $Home/src

Ein Paar Compilerflags zur optimierung zu Anfang!

1
2
3
4
5
6
MACOSX_DEPLOYMENT_TARGET=10.6
CFLAGS="-arch x86_64 -g -O2 -pipe -no-cpp-precomp"
CCFLAGS="-arch x86_64 -g -O2 -pipe"
CXXFLAGS="-arch x86_64 -g -O2 -pipe"
LDFLAGS="-arch x86_64 -bind_at_load"
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET=10.6
CFLAGS="-arch x86_64 -g -O2 -pipe -no-cpp-precomp"
CCFLAGS="-arch x86_64 -g -O2 -pipe"
CXXFLAGS="-arch x86_64 -g -O2 -pipe"
LDFLAGS="-arch x86_64 -bind_at_load"
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET

libmcrypt bauen

1
2
3
4
5
./configure --disable-posix-threads
 
make
 
sudo make install
./configure --disable-posix-threads

make

sudo make install

danach lib jpeg und libpng jeweils mit

1
2
3
4
5
./configure --enable-shared
 
make
 
sudo make install
./configure --enable-shared

make

sudo make install

zuletzt noch die PCRE Lib

1
2
./configure --enable-utf8 --enable-unicode-properties
make
./configure --enable-utf8 --enable-unicode-properties
make
1
make install DESTDIR=$HOME/src/pcre
make install DESTDIR=$HOME/src/pcre

Nun können wir uns an PHP machen, dieses Konfigurieren wir mit:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
./configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-dependency-tracking \
--sysconfdir=/private/etc \
--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 \
--with-curl=/usr \
--enable-exif \
--enable-ftp \
--with-gd \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/X11R6 \
--with-freetype-dir=/usr/X11R6 \
--with-xpm-dir=/usr/X11R6 \
--with-ldap=/usr \
--with-ldap-sasl=/usr \
--enable-mbstring \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/tmp/mysql.sock \
--with-iodbc=/usr \
--enable-shmop \
--with-snmp=/usr \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-mcrypt=/usr/local \
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--with-pcre-regex=$HOME/src/pcre
./configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-dependency-tracking \
--sysconfdir=/private/etc \
--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 \
--with-curl=/usr \
--enable-exif \
--enable-ftp \
--with-gd \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/X11R6 \
--with-freetype-dir=/usr/X11R6 \
--with-xpm-dir=/usr/X11R6 \
--with-ldap=/usr \
--with-ldap-sasl=/usr \
--enable-mbstring \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/tmp/mysql.sock \
--with-iodbc=/usr \
--enable-shmop \
--with-snmp=/usr \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-mcrypt=/usr/local \
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--with-pcre-regex=$HOME/src/pcre

nach dem erfolgreichen configure könnt ihr das übliche laufen lassen

danach habe ich mir sicherheitshalber noch die alten binaries abgesichert, falls doch was schief gelaufen ist

1
2
3
sudo cp /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.apple
 
sudo cp /usr/bin/php /usr/bin/php.apple
sudo cp /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.apple

sudo cp /usr/bin/php /usr/bin/php.apple

und Action!

1
sudo make install
sudo make install

Viel Spass mit einer nun vollwertigen php Installation ;)

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Add to favorites
  • Email
  • RSS

Write a comment