Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics PHP on the Web Including PHP

favorites.php file does not exist


I have run the script: <?php include 'inc/favorites.php'; ?> below the heading 'A Few of My Favourite Things'. However because the file favourites.php doesn't actually seem to exist the code will not run.

Can you help please?



<title>A Few of My Favorite Things</title>
<h1>A Few of My Favorite Things</h1>
  <?php include 'inc/favorites.php'; ?>


2 Answers

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Hi there! You've included a favorites.php from inside a folder called "inc". However, for the challenge this folder doesn't exist. Try removing the "inc" folder and just include the file. In this scenario it's located in the current directory. Hope this helps! :sparkles:

Hi Jennifer,

Thanks for your response, you were absolutely right.



Josh Foster
Josh Foster
8,896 Points

The include function takes arguments within parentheses. Your included file must be contained within parentheses like this: <?php include('inc/favorites.php'); ?>. Hope this helps.

Hi Josh,

Thanks for the advise.