Skip to content

Instantly share code, notes, and snippets.

@jonathantneal
Created July 9, 2014 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathantneal/24e0a6db2df58e5b9a87 to your computer and use it in GitHub Desktop.
Save jonathantneal/24e0a6db2df58e5b9a87 to your computer and use it in GitHub Desktop.
Local Phorkie Setup for Mac OSX

Local Phorkie Setup for Mac OSX

These instructions are intended to be used on Mac OSX Mountain Lion and Mavericks. They may also work for Yosemite, but have not been tested.


Installing Phorkie

This step copies Phorkie to your local Sites directory.

Within Terminal, add Phorkie to your Sites directory.

mkdir ~/Sites/phorkie

Next, copy Phorkie to your Sites’ Phorkie directory.

cp phorkie-0.4.0.phar ~/Sites/phorkie

That’s it!

Configuring .phar files

This step makes your Apache installation recognize .phar files.

Within Terminal, edit your PHP configuration file.

edit /etc/apache2/other/php5.conf

Within your editor, add the .phar extension to the application/x-httpd-php type.

<IfModule php5_module>
  AddType application/x-httpd-php .phar .php
  AddType application/x-httpd-php-source .phps

  <IfModule dir_module>
    DirectoryIndex index.html index.php
  </IfModule>
</IfModule>

That’s it!

Setting up your Host

This step makes your computer load http://phorkie from itself.

Within Terminal, edit your Hosts file.

edit /private/etc/hosts

Within your editor, add Phorkie as a Host entry.

127.0.0.1       phorkie

That’s it!

Setting up your VirtualHost

This step makes your Apache installation load http://phorkie from your local Sites directory.

Within Terminal, edit your VirtualHosts file.

edit /private/etc/apache2/extra/httpd-vhosts.conf

Within your editor, add a Phorkie VirtualHost (where %USERNAME% is your username).

<VirtualHost *:80>
  ServerName phorkie
  DocumentRoot "/Users/%USERNAME%/Sites/phorkie"
    <Directory "/Users/%USERNAME%/Sites/phorkie">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Within Terminal, test your Apache configuration.

apachectl configtest

Next, if this returns the message Syntax OK, restart Apache.

sudo apachectl restart

That’s it!


Well done! Now you’re ready to play. Open http://phorkie/phorkie-0.4.0.phar from your web browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment