Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Mac OS X Server with AMPPS & Slim V3

I'm using AMPPS to create a local environment and I ran into a hiccup that I wanted to help someone else avoid.

This is the error I was getting:

Parse error: syntax error, unexpected '[' in /Applications/AMPPS/www/Project_01/vendor/nikic/fast-route/src/functions.php on line 12

Why the error occurred:

Slim V3 requires PHP 5.5 and AMPPS (as of 12/15/15) uses PHP 5.3 by default.

How to fix:

  1. Stop your server
  2. Go to the PHP section and click 'Change PHP Version'
  3. Change version to 5.5 and click 'Apply'
  4. Fire up the server and then reload your index.php page