5 October, 2014

Install PHPixie on a Mac
By: Matthew Jackson

MampThe first thing to do is to install MAMP. This will be your local webhosting server. You technically already have much of the software installed on your apple computer, but MAMP puts it all in one place in a simple GUI. Just clicking start will setup everything and allow you to stop it easily. Similarly any mac OS updates that might break your server, but with Mamp they will obviously focused on making sure their one product doesn't break. Go to: http://www.mamp.info/en/index.html, Download and Install.

Now, you should have a folder: "/Applications/MAMP/htdocs" This folder will be where all your web files are contained.

  1. Open Terminal
  2. Run the following in the Terminal:
    1. cd /Applications/MAMP/htdocs
    2. curl -s https://getcomposer.org/installer | php -d detect_unicode=Off
    3. php composer.phar create-project phpixie/project tutorial 2.*-dev --prefer-dist
  3. To Update any code in the future:
    1. cd /Applications/MAMP/htdocs/tutorial
    2. php ../composer.phar update -o
  4. Finally you need to setup Mamp.
    1. Run MAMP (the icon should be in your tray, or look in Applications/MAMP)
    2. Click "Preferences..."
    3. Click "Apache"
    4. Set Document Root to "/Applications/MAMP/htdocs/tutorial/web"
  5. Now test it at: http://localhost:8888

The key in step 4 is to always set the document root to your "web" folder. There is the index.php file that calls the whole PHPixie.

You might be tempted to take the files out of the folder "tutorial" and redirect the document root to "/Applications/MAMP/htdocs/web". But with the folder you can have multiple websites and switch them by switching the DocumentRoot setting. It is up to you. You can also download the package from Github and not use composer, but composer will be useful to add modules and update them. Please go the composer route, I didn't at first, but now I have and it is much more enjoyable!

Have Fun with PHPixie it is great!

 

Tags: PHPixie