Difference between revisions of "InstallingAboutUsOnOSX/php"

 

(4 intermediate revisions by 3 users not shown)



Line 1: Line 1:
This is one step in the [[InstallingAboutUsOnOSX]] process.
+
I needed to do this to fix the broken install of PHP/MySQL on Vinh's machine.
 
 
Below is what Brandon uses, which uses freetype from MacPorts
 
 
<pre>
 
<pre>
sudo port deactivate libiconv zlib libxml2 libxslt jpeg tiff libpng
+
cd /usr/local/mysql/lib
sudo port install libiconv +universal
+
mkdir mysql
sudo port install zlib +universal
+
cp libmysqlclient.15.dylib mysql/libmysqlclient.15.dylib
sudo port install libxml2 +universal
 
sudo port install libxslt +universal
 
sudo port install jpeg +universal
 
sudo port install tiff +universal
 
sudo port install libpng +universal
 
sudo port install freetype +universal
 
sudo port install gd2 +universal
 
sudo port install bzip2 +universalb
 
 
</pre>
 
</pre>
  
I had to patch the php source code to change all references to iconv_open and iconv_close to libiconv_open and libiconv_close respectively to get it to build properly (see [[InstallingAboutUsOnOSX/php/iconv.patch]]).  When I had libcurl support, my openid tests would die with a bus error.
+
This is one step in the [[InstallingAboutUsOnOSX]] process.
 +
 
 +
I had to patch the php source code to change all references to iconv_open and iconv_close to libiconv_open and libiconv_close respectively to get it to build properly (see the patch at http://pastie.org/313423.txt or do a multi file find and replace for the mentioned text).  When I had libcurl support, my openid tests would die with a bus error.
  
 
<pre>
 
<pre>
Line 24: Line 16:
 
tar jxvf php-5.2.5.tar.bz2
 
tar jxvf php-5.2.5.tar.bz2
 
cd php-5.2.5
 
cd php-5.2.5
curl -O http://www.aboutus.org/skins/support/php-5.2.5-iconv.patch
+
curl http://pastie.org/313423.txt -o php-5.2.5-iconv.patch
 
patch -p1 < php-5.2.5-iconv.patch
 
patch -p1 < php-5.2.5-iconv.patch
 
./configure \
 
./configure \
Line 90: Line 82:
 
'--enable-gd-native-ttf' \
 
'--enable-gd-native-ttf' \
 
</pre>
 
</pre>
 +
 +
Ports choked on some of my packages, I used fink, and it seemed to install them fine.
 +
I also used this link as a reference:
 +
http://www.pommepause.com/online_files/compile_php5_mac.html
 +
PHP
  
 
== Old ==
 
== Old ==

Latest revision as of 16:47, 13 November 2008

I needed to do this to fix the broken install of PHP/MySQL on Vinh's machine.

cd /usr/local/mysql/lib
mkdir mysql
cp libmysqlclient.15.dylib mysql/libmysqlclient.15.dylib

This is one step in the InstallingAboutUsOnOSX process.

I had to patch the php source code to change all references to iconv_open and iconv_close to libiconv_open and libiconv_close respectively to get it to build properly (see the patch at http://pastie.org/313423.txt or do a multi file find and replace for the mentioned text). When I had libcurl support, my openid tests would die with a bus error.

mkdir -p /www/build
cd /www/build
curl -O http://us.php.net/distributions/php-5.2.5.tar.bz2
tar jxvf php-5.2.5.tar.bz2
cd php-5.2.5
curl http://pastie.org/313423.txt -o php-5.2.5-iconv.patch
patch -p1 < php-5.2.5-iconv.patch
./configure \
 --with-iconv-dir=/opt/local \
 --prefix=/www \
 --with-apxs2=/www/bin/apxs \
 --with-mysql=/usr/local/mysql-5.0.45-osx10.4-i686 \
 --with-zlib \
 --with-bz2=/opt/local \
 --enable-soap \
 --enable-bcmath \
 --with-gd \
 --with-png-dir=/opt/local \
 --with-freetype-dir=/opt/local \
 --with-zlib-dir=/opt/local \
 --with-jpeg-dir=/opt/local \
 --with-gettext=/opt/local \
 --with-gmp=/opt/local \
 --with-openssl=/opt/local
 make
 make install
 cd /www/bin
 ln -s php.dSYM php

below is what jason uses, which uses Freetype from fink

'./configure' \
'--with-apxs2=/www/bin/apxs' \
'--enable-so' \
'--with-mysql=/usr/local/mysql' \
'--enable-mbstring' \
'--with-pgsql' \
'--with-zlib' \
'--enable-soap' \
'--enable-gmp' \
'--enable-bcmath' \
'--with-gd' \
'--with-png' \
'--with-png-dir=/www' \
'--with-freetype' \
'--with-freetype-dir=/sw/lib/freetype2' \
'--enable-gd-native-ttf' \
"$@"

Here's what worked for me (stephen): (I had to make sure to install the gd2, not the gd, package, for it to work)

'./configure' \
'--prefix=/www' \
'--with-apxs2=/www/bin/apxs' \
'--enable-so' \
'--with-mysql=/usr/local/mysql' \
'--enable-mbstring' \
'--with-zlib' \
'--enable-soap' \
'--enable-gmp' \
'--enable-bcmath' \
'--with-gd=/sw' \
'--with-png' \
'--with-png-dir=/sw' \
'--with-freetype' \
'--with-freetype-dir=/sw/lib/freetype2' \
'--enable-gd-native-ttf' \

Ports choked on some of my packages, I used fink, and it seemed to install them fine. I also used this link as a reference: http://www.pommepause.com/online_files/compile_php5_mac.html PHP

Old

Below is what Brandon uses, which uses a hand compiled freetype

 mkdir -p /www/compile
 cd /www/compile
 wget http://us2.php.net/get/php-5.2.1.tar.bz2/from/us.php.net/mirror
 tar -jxvf php-5.2.1.tar.bz2
 cd php-5.2.1
 CFLAGS='-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -L/www/lib' \
 LDFLAGS='-L/www/lib' \
 ./configure \
 --prefix=/www \
 --enable-so \
 --with-apxs2=/www/bin/apxs \
 --with-mysql=/usr/local/mysql-debug-5.0.27-osx10.4-i686 \
 --with-zlib \
 --enable-soap \
 --enable-gmp \
 --enable-bcmath \
 --with-gd \
 --with-png \
 --with-png-dir=/www \
 --with-zlib-dir=/www \
 --with-freetype-dir=/www
 make clean
 make
 make install


Retrieved from "http://aboutus.com/index.php?title=InstallingAboutUsOnOSX/php&oldid=16959414"