Welcome to the navigation

Nisi officia ullamco consequat, veniam, tempor ex reprehenderit excepteur amet, proident, duis lorem dolore quis eiusmod eu fugiat esse aute aliqua, dolor do incididunt enim. Ad consequat, nisi exercitation culpa in adipisicing nulla qui sint consectetur nostrud esse duis ut tempor laboris ea ipsum enim aliquip ut deserunt magna cupidatat

Yeah, this will be replaced... But please enjoy the search!

Downgrading PHP 5.3.0 to 5.2.11 on Snow Leopard Server

Categories Tags
Many thanks to Jeff Seibert for his excellent guide, however it needs some clarifications and extra info for newbies.

1. Check that you need this

Open a console and enter
$php --version
If the reply is similar to this
PHP 5.3.0 (cli) (built: Jul 19 2009 00:34:30)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
then you can proceed. Otherwise, don't.

2. Install Xcode on your server

If not installed, install it from the "other installs" folder of your Snow Leopard DVD or via Apple's site.

3. Install the “Snow Leopard” version of MacPorts from macports

Go to this webpage and get the Snow Leopard package. Install it.

4. Open the terminal, or ssh

$sudo port -v selfupdate
$sudo port -f uninstall installed
$sudo port install php52 +mysql5 +sqlite
$sudo cp /opt/local/etc/php5/php.ini-dist /opt/local/etc/php5/php.ini
These commands may take some time, easily up to an hour if you have an older system.

5. Change some setting files

Edit /etc/apache2/httpd.conf and change
# Here is a suggested series of commands
# I use nano, you may use other text editors as well
$sudo nano /etc/apache2/httpd.conf

# Press control + w to search (with nano)
# In my file this is line 152, but this may vary
Search: LoadModule php5_module

# Change
# To
Edit /opt/local/etc/php5/php.ini
$sudo nano /opt/local/etc/php5/php.ini

# If the file doesn't exist there is another one
$sudo cp /opt/local/etc/php5/php.ini-recommended /opt/local/etc/php5/php.ini

# Find and change
mysql.default_socket =
# To
mysql.default_socket = /var/mysql/mysql.sock

6. Restart the web service

With the Server Admin tool, the sharing pane in system preferences or
$sudo serveradmin stop web && sudo serveradmin stop mysql
$sudo serveradmin start web && sudo serveradmin start mysql
Or use the serviceRestart for a more complete reset of the server.

7. Check the results

$ php --version
PHP 5.2.11 (cli) (built: Oct  7 2009 03:34:39)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies