Posts Tagged "php"

Compile PHP Extensions on Mac Snow Leopard OS X

If you have to custom compile PHP Extensions on Mac with Snow Leopard OS X while using MAMP , you will need to execute following commands. These are necessary to compile modules with both 32bit and 64bit support.

/Applications/MAMP/bin/php5.3/bin/phpize
MACOSX_DEPLOYMENT_TARGET=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_at_load"
export CFLAGS CXXFLAGS LDFLAGS CCFLAGS MACOSX_DEPLOYMENT_TARGET

How to downgrade PHP to 5.2 on Ubuntu?

Here is a quick script to do this task:

Courtsey of Stijn Beauprez from here: http://thejibe.com/blog/10/5/php-5210-debs-ubuntu-104-lucid#comment-9

#! /bin/sh
php_packages=`dpkg -l | grep php | awk ‘{print $2}’`

sudo apt-get remove $php_packages

sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list

sudo mkdir -p /etc/apt/preferences.d/

for package in $php_packages;
do echo “Package: $package
Pin: release a=karmic
Pin-Priority: 991
” | sudo tee -a /etc/apt/preferences.d/php
done

sudo apt-get update

sudo apt-get install $php_packages

To undo the script and upgrade to php 5.3 you will need to delete the file (sudo rm /etc/apt/preferences.d/php), run sudo apt-get update, and then sudo apt-get dist-upgrade which will get the latest packages for your distribution, including the PHP packages. (Ben Holt)