Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Getting Snow Leopard 10.6.4 running php 5.3.2 with Truetype2

Hi,

Without using Darwin Port, how can I get php 5.3.2 working with truetype2 functions such as ImageTTFbBox() on Snow Leopard 10.6.4?

I've try to recompile php 5.3.2 with freetype-2.4.3, jpeg-8b, libpng-1.4.4 and pcre-7.9

To avoid compile error, I changed '#define iconv iconv' in 'php5.3.2/ext/iconv/iconv.c' but it doesn't give me expected result. I fact builded 'phplib5.so' has no graphics.

Do you know the right 'MACOSX DEPLOYMENTTARGET=10.6' syntax for all given modules under a x86_64 architecture machine?
What are the right qualifiers for 'make' and 'make install' to solve 'truetype2 running with php' issue?

Thanks for your help!

iMac 27p i7, Mac OS X (10.6.4)

Posted on Oct 31, 2010 5:19 PM

Reply
6 replies

Nov 1, 2010 6:38 AM in response to etresoft

HI,

Thanks for giving me the XAMPP solution. There is also the mamp-pro solution.

But I don't want to solve my problem with external solution. My goal is to get things work compiling open sources distributions. Do you know when Apple will solve the conflicts between Apache, PHP, font-handling and MacOS X Core Libraries (at 10.6.5)?

Is there any solutions such as Michael Gracie explains to plug mcrypt into PHP for Truetype2 without building a new phplib.so library? For mcrypt this solution works pretty well for me.

Cheers,

Nov 1, 2010 10:00 AM in response to JL Attenoux

JL Attenoux wrote:
But I don't want to solve my problem with external solution. My goal is to get things work compiling open sources distributions. Do you know when Apple will solve the conflicts between Apache, PHP, font-handling and MacOS X Core Libraries (at 10.6.5)?


I do not. You might check here for more information: http://lists.apple.com

Is there any solutions such as Michael Gracie explains to plug mcrypt into PHP for Truetype2 without building a new phplib.so library? For mcrypt this solution works pretty well for me.


I found similar solutions last night, but I didn't expect you would want to try them. Try the last message posted here: http://discussions.apple.com/message.jspa?messageID=5969911#5969911

Basicaly, you have to build FreeType2 without the Mac-specific extensions. You won't be able to use your MacOS X system fonts, but you can use your own.

Nov 1, 2010 4:47 PM in response to etresoft

Hi,

I have try the solution explained in http://discussions.apple.com/message.jspa?messageID=5969911#5969911 with following bash commands :

+ bash-3.2# CFLAGS=-DBIND 8COMPAT\\+ + bash-3.2# export CFLAGS\\+ + bash-3.2# MACOSX DEPLOYMENTTARGET=10.6 \ \\+ + CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" \ \\+ + CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" \ \\+ + CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" \ \\+ + LDFLAGS="-arch i386 -arch x86_64 -bind atload" \ \\+ + ./configure \ \\+ + --prefix=/usr \ \\+ + --mandir=/usr/share/man \ \\+ + --infodir=/usr/share/info \ \\+ + --disable-dependency-tracking \ \\+ + --with-apxs2=/usr/sbin/apxs \ \\+ + --with-ldap=/usr \ \\+ + --with-kerberos=/usr \ \\+ + --enable-cli \ \\+ + --with-zlib-dir=/usr \ \\+ + --enable-trans-sid \ \\+ + --with-xml \ \\+ + --enable-exif \ \\+ + --enable-ftp \ \\+ + --enable-mbstring \ \\+ + --enable-mbregex \ \\+ + --enable-dbx \ \\+ + --enable-sockets \ \\+ + --with-iodbc=/usr \ \\+ + --with-curl=/usr \ \\+ + --with-config-file-path=/etc \ \\+ + --sysconfdir=/private/etc \ \\+ + --with-mysql=mysqlnd \\+ + --with-mysqli=mysqlnd \ \\+ + --with-pdo-mysql=mysqlnd \ \\+ + --with-mysql-sock=/var/mysql/mysql.sock \ \\+ + --with-openssl \ \\+ + --with-xmlrpc \ \\+ + --with-xsl=/usr \ \\+ + --without-pear \ \\+ + --with-freetype-dir=/usr/local/lib \ \\+ + --with-jpeg-dir=/usr/local/lib \ \\+ + --with-png-dir=/usr/X11R6 \ \\+ + --with-xpm-dir=/usr/X11R6 \ \\+ + --with-gd \ \\+ + --with-ttf \ \\+ + --with-iconv=/usr/local/lib \ \\+ + --enable-gd-imgstrttf \ \\+ --enable-gd-native-ttf

Before issuing make, I have to change in php-5.3.2/ext/iconv/iconv.c file +#define iconv libiconv+ into +#define iconv iconv+ to let this command run through.

+ bash-3.2# make+
+bash-3.2# make test+
+ bash-3.2# mv /usr/bin/php /usr/bin/php.original+
+ bash-3.2# mv /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.original+
+ bash-3.2# make install+
+ bash-3.2# apachectl gracefull+

My phpinfo() test page shows:

+ GD Support enabled \\+ + GD Version bundled (2.0.34 compatible) \\+ + FreeType Support enabled \\+ + FreeType Linkage with freetype \\+ + FreeType Version 2.4.3 \\+ + GIF Read Support enabled \\+ + GIF Create Support enabled \\+ + JPEG Support enabled \\+ + libJPEG Version unknown \\+ + PNG Support enabled \\+ + libPNG Version 1.2.35 \\+ + WBMP Support enabled \\+ + XPM Support enabled \\+ + XBM Support enabled \\+

But finally, I get the same result. No more graphics!
So I revert to original state:

+ bash-3.2# mv /usr/bin/php /usr/bin/php.truetype+
+ bash-3.2# mv /usr/bin/php.original /usr/bin/php+
+ bash-3.2# mv /usr/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so.truetype+
+ bash-3.2# mv /usr/libexec/apache2/libphp5.so.original /usr/libexec/apache2/libphp5.so+
+ bash-3.2# apachectl gracefull+

Any ideas?

Getting Snow Leopard 10.6.4 running php 5.3.2 with Truetype2

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.