Main Author: Antonio Alcorn Contributor: Angelo Embuldeniya Maintainer: Tim McNamara

Installing Sahana on Mac OS X

Sahana requires just a few tweaks to get up and running.

Phase 1 Recap

You should have installed the following during Phase 1:

  • php 5.0 or later
  • MySQL 4.1 or later
  • Apache web server 1.3 or later
  • latest php4-gd libs

phpMyAdmin is also recommended.

Mac OSX Specific Notes

If you have Mac OS X 10.4 (Tiger) or later, it's usually shipped with php4, but the installation is slightly quirky. Previous versions of the OS didn't ship with PHP at all. In either case you'll need to download and install the “ PHP 5 on Mac OS X 10.4, PPC and Intel” package from Marc Liyanage's site.

If you want to use a local mysql database, you'll need to install that as well. Go here and scroll down to the Mac OS X downloads. Download the “Standard” disk image for your platform. Run the installer, and while you're at it double-click the handy prefPane supplied on the disk image to install it. The initial default mysql user is called root, with a blank password. mysqladmin will be located at /usr/local/mysql/bin/mysqladmin, so, for example, to create your database for sahana the command might look like:

/usr/local/mysql/bin/mysqladmin -u root create sahana_db

You might also want to install a copy of phpMyAdmin.

Next Steps

  • Unpack the tarball. A folder sahana, should be extracted. Move this folder into the Sites directory of your your home folder. Linking to a specific section is possible, too. (See note below)

* In Terminal, grant the webserver write permission to the conf/ and www/tmp/ directories under sahana. In Mac OS X, the webserver runs as 'nobody', so we'll set them to world-writable. For example:

powerbook:~ antonio$ chmod a+w Sites/sahana/conf/  
powerbook:~ antonio$ chmod a+w Sites/sahana/www/tmp/
  • Sahana makes extensive has removed PHP's optional “short tags” feature in its code (the <? …code… ?> or <?=something to print?> syntax). Short tags are disabled in the default installation of php5. While the developers are moving through a transition to Version 1.0, it pays to enable this feature.

To fix this, edit /usr/local/php5/lib/php.ini and look for:

short_open_tag = Off

and change it to:

short_open_tag = On

then save the changes.

  • Go to System Preferences > Sharing > Services and turn Personal Web Sharing on. If you already had it on, turn it off and then on again. This restarts the Apache process and forces it to reload httpd.conf and php.ini.

Configuring Apache

By default, the Apache installation included with Mac OS X maps http://localhost/~yourusername/ to /Users/yourusername/Sites/, and http://localhost/ to /Library/WebServer/Documents/. If you want to install sahana with a “nice” namespace, edit /etc/httpd/httpd.conf.

Find the following line:

DocumentRoot "/Library/WebServer/Documents/"

You could change it to where you have unpacked Sahana. For example:

DocumentRoot "/Users/yourusername/Sites/sahana/www/"

Restart Apache by going to System Preferences > Sharing > Services and turn Personal Web Sharing off then on again. This browsing to http://localhost/ would bring you to your Sahana installation.

QR Code
QR Code doc:installosx:english (generated for current page)