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

Stephen Gragg
Stephen Gragg
738 Points

Using my browser, I am unable to locate the directory containing the project files for the PHP and SQL course.

I know I am placing this set of files into the appropriate location so that I can navigate to them from local host. I have been successful with the other course files, and I have placed empty directories into my intended location and can navigate to them just fine. For whatever reason, my browser cannot seem to locate these particular files.

Stephen Gragg
Stephen Gragg
738 Points

Also, I am using a WAMP server. I did change my Apache config file to enable rewrites. I can now navigate to the appropriate directory, but my browser gives an error message when trying to load the page.

Brian Polonia
Brian Polonia
25,139 Points

You posted this question as a CSS topic. I don't know the answer to your question, but it will help if you change the topic to PHP. Someone with knowledge on PHP will find your question easier.

best regards,

Brian

Stephen Gragg
Stephen Gragg
738 Points

Whoops! My mistake. That's been fixed now.

4 Answers

Can you post the error that the browser displayed when you tried to load the page?

Also, post the URL that you are trying to access.

Have you double checked that the file extension is still labeled .php?

Stephen Gragg
Stephen Gragg
738 Points

The warning is:

( ! ) Warning: include(C:/wamp/www/inc/products.php): failed to open stream: No such file or directory in C:\wamp\www\PHP-sql\index.php on line 4 Call Stack

Time Memory Function Location

1 0.0004 251728 {main}( ) ..\index.php:0

( ! ) Warning: include(): Failed opening 'C:/wamp/www/inc/products.php' for inclusion (include_path='.;C:\php\pear') in C:\wamp\www\PHP-sql\index.php on line 4 Call Stack

Time Memory Function Location

1 0.0004 251728 {main}( ) ..\index.php:0

( ! ) Fatal error: Call to undefined function get_products_recent() in C:\wamp\www\PHP-sql\index.php on line 5 Call Stack

Time Memory Function Location

1 0.0004 251728 {main}( ) ..\index.php:0

It occurs when I navigate to the directory "PHP-sql" in my home directory, which is the folder I made to drop the downloaded files into.

So it's looking one level too high for the inc/ directory (looking in C:/wamp/www/ instead of C:/wamp/www/PHP-sql/).

If you set the global variable for the base path or something like that in one of the previous stages, you might need to change it there.

What is the actual PHP code in index.php that refers to the inc/products.php file? It would be on line 4 according to the errors you posted...

Stephen Gragg
Stephen Gragg
738 Points

Bingo. You nailed it Iain. I took everything out of the PHP-sql directory and put it into my root directory, and it worked. Not sure why they set up the files that way...this is the first set in this module.

Excellent. Enjoy the rest of the course!