This is an old revision of the document!


Main Author: Antonio Alcorn Contributor(s): angelo Embuldeniya

Installing Sahana on Mac OS X

Sahana is designed to run on any system running PHP and MySQL. On Mac OS X, it requires just a few tweaks to get up and running.

Sahana requires the following to be installed on Mac OS X:

o php 4.3 or later
o MySQL 4.1 or later
o Apache web server 1.3 or later
o latest php4-gd libs
o phpMyAdmin

Steps

  • Download the “source” package for your preferred release from here
  • Unpack the tarball. You should get a folder called sahana. Move this folder into the “Sites” directory in your home folder. Linking to a specific section is possible, too. (See note below)
  • In Terminal, set the permissions for the conf/ and www/tmp/ directories under sahana to be writable by the webserver. In Mac OS X, the webserver runs as 'nobody', so we'll set them to world-writable. For example:
o powerbook:~ antonio$ chmod 777 Sites/sahana/conf/  
o powerbook:~ antonio$ chmod 777 Sites/sahana/www/tmp/
  • 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:
o /usr/local/mysql/bin/mysqladmin -u root create sahana_db

You might also want to install a copy of phpMyAdmin

  • Sahana makes extensive use of PHP's optional “short tags” feature (the <? …code… ?> or <?=something to print?> syntax). Short tags are disabled in the default installation of php5. To fix this, edit /usr/local/php5/lib/php.ini and look for this line:
o short_open_tag = Off

…and change it to:

o short_open_tag = On

then save the changes.

  • Go to System Preferences > Sharing > Services and turn on Personal Web Sharing. 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.

Notes:

  • 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, you can edit /etc/httpd/httpd.conf and find the following line:
    o DocumentRoot "/Library/WebServer/Documents/"

You could change it to something like:

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

And restart apache. Then, if you put the sahana folder in your Sites folder, browsing to http://localhost/ would bring you to your Sahana installation.


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