changing the digital world one bit at a time...

Blants (noun) the rants of a blogger

  1. How to Enable PHP in Apache for Mac OS X

    June 19, 2013 by The Man

    Simply open terminal and type

    sudo nano /etc/apache2/httpd.conf

    Then find the line

    #LoadModule php5_module libexec/apache2/

    and remove the hashtag, save then type

    sudo apachectl restart

    to restart Apache.

  2. Run NoSQL (MongoDB) on OS X 10.8 with PHP support

    June 1, 2012 by The Man

    Wow it’s quite easy

    1. Download Mongo from here

    2. Grab the PHP drivers from here

    3. Unzip 2. and move to /usr/lib/php/extensions/no-debug-non-zts-20090626/

    4. Edit php.ini and add then restart Apache

    5. Start Mongo by extracting the files in 1. then fire up terminal and make a data directory with sudo mkdir -p /data/db for the data then run sudo mongod to run the server.

    6. Head over to here for a basic Hello World

    7. Download MongoHub for a nice, sexy GUI at – and it’s even on github – perfect.

    Easy peasy….

  3. Blank page when trying to install Joomla on OSX10.6

    September 10, 2010 by The Man

    If you get a blank page when you try and install Joomla check to make sure you have safe_mode turned off.

    Now safe_mode is set in your php.ini file but also in httpd.conf. The php script below may help you debug a few errors.

    mysql_select_db("test") or die(mysql_error());
    echo "Connected to Database";

  4. Using Eclipse for php development on OSX

    September 4, 2010 by The Man

    I am starting to hate Visual Studio more and more as it gets slower and slower so it was about time I set up a new dev environment on my Mac so I didn’t need to start a VM to run the only app I now ever use on Windows.

    Enter Eclipse which I use for Java development for a payment system on AS400 and a bit of Android stuff but never really for PHP

    I downloaded the latest version with PHP support which is now 64bit and was ready to go. But not so fast. Having created a test site in the default location (/Users/Brian/Documents/workspace) I ran the site up in the local window. Bum 404 not found.

    Ok this was easy to solve. Go to /etc/apache/httpd.conf and add an alias

    Alias /myBMI /Users/Brian/Documents/workspace/myBMI

    and a directory listing

    Options All MultiViews 
    AllowOverride None 
    Order allow,deny 
    Allow from all 

    then save and restart Apache sudo /usr/sbin/apachectl restart

    Great it finds the page but I now get a permission denied 403. This one took a little longer and it is a bit of a fudge. Now this is a development machine so I don’t really need to worry about security as it will never be on the web. While in httpd.conf look for User and you will see it is set to _www. Now OSX doesn’t make it easy to change permissions and what I really should have done is given _www permissions to my workspace folder but it was quicker to just change the user to me.

    User Brian
    Group _www

    Save and restart Apache and we are go for PHP development. Thanks to Suburbia for the pointers.