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 Designing Interfaces in PHP Introducing Interfaces Implementing an Interface

'Interface "RepositoryInterface" not found error'

I'm really stuck on this video.

After previewing my workspace at the creation of the $repo variable in the config.php file I get a fatal error of :-

"Fatal error: Interface 'RepositoryInterface' not found in /home/treehouse/workspace/src/classes/jsonRepository.php on line 3"

I've pored over the video and Alena's code many times and can't see my error. I've also restarted from the beginning of the video and recreated all my files and code but still get the error.

I've posted a snapshot of my workspace below.

http://w.trhou.se/7xtyulxck9

Thanks in advance for any help Don :-)

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I took the liberty of forking your workspace and looking around. I did manage to get it to the point where it has the same errors she has at this point in the videos. Now, I'm not exactly sure how this happened, but I found the error.

In interfaces/RepositoryInterface.php on the top line, your code starts with:

<?

For some reason, the php part is removed. It should start with:

<?php

I believe at this point that file can't even be interpreted as PHP because of that so it's trying to implment an interface it doesn't have access to (or really exist) at this point. Make that change and see if you can get back on track!

Hope this helps! :sparkles:

Well that's embarrassing..... :-) Didn't even think to check for that.

Thanks for taking the time to look it over and the help.

Cheers Don :-)