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
Kevin Lozandier
Courses Plus Student 53,747 PointsFinal version of Shirts4Mike before PHP w/ MYSQL course doesn't work out of the box, ROOT_PATH paths unresolveable and causes exceptions
For some reason on XAMPP or a PostgreSQL apache installation (or any localhost installation I've tried on Windows), the final .zip for the Shirts4Mike project does not work out of the box and is somewhat hard to grasp to get working because the ROOT_PATH being generated by its use on the files doesn't seem to be working correctly.
The correct path is generated (i.e. C:/xampp/htdocs/shirts4mike/shirts/shirts.php), but it causes unrecoverable exceptions to occur.
Looked into and tried to use other keys of the $_SERVER according to the PHP manual. Already familiar with PHP, was hoping to dive right into this course, but have tried the earlier projects to see if my PHP skills are degrading (being more of a RoR user) and it's becoming apparent that wasn't the case. Randy Hoyt, any advice?
9 Answers
Hampton Paulk
5,093 PointsI will take a look later today and see if I can replicate the issue.
Carlos E. Quiroz Rojas
15,278 PointsI found The same Issue y change the port in the the database.php file for 3306 to conect to My SQL and it get contetion all ready with the data base but when I try to review the index.php I get a page with 3 errors something like this
Warning: include(D:/XAMPP/htdocs/inc/products.php): failed to open stream: No such file or directory in D:\XAMPP\htdocs\shirts4mike\index.php on line 4
Warning: include(): Failed opening 'D:/XAMPP/htdocs/inc/products.php' for inclusion (include_path='.;D:\XAMPP\php\PEAR') in D:\XAMPP\htdocs\shirts4mike\index.php on line 4
Fatal error: Call to undefined function get_products_recent() in D:\XAMPP\htdocs\shirts4mike\index.php on line 5
I see before this error in a Mac and I figured out how to fix but in a PC I get a littel bit lost Kevin Lozandier if I found somethin in the day I let you know... Randy any advice??
Kevin Lozandier
Courses Plus Student 53,747 PointsRandy Hoyt, where are thou? :P
Carlos E. Quiroz Rojas
15,278 PointsI almost finish the course but the site still no working!! I was thinking was something related with the version of XAMMP I changed the version but still nothing
Kevin Lozandier
Courses Plus Student 53,747 PointsAndrew Chalkley : Any ideas on help?
Andrew Chalkley
Treehouse Guest TeacherHI Kevin Lozandier,
I don't know what the issue is personally as I don't use XAMPP that much. Hampton Paulk has taken over from Randy Hoyt on the PHP material and has access to a Windows box in Orlando, so we'll see if he can replicate your issue or help.
Thanks for your patience.
Andrew
Rob Chojnacki
7,554 PointsI cannot get any of the downloadable code to work in this project. One big programming error I noticed on several pages was the use of double quotes inside of double quotes.
For instance, in "header.php", each <li> line is coded incorrectly. Each <li> has php code in it's class value. The value is encased in DOUBLE QUOTES, and inside those double quotes, there is PHP code, echoing strings that are ALSO encased in DOUBLE QUOTES. This error appears many times throughout the project site. So I attempted to find each instance and fix it.
Unfortunately, after going through all the code in the site to fix all these errors, the site still does not work at all. :/
Also, it seems this error appears in each downloadable code .zip throughout the "Simple PHP Function" track AND the "Using PHP with MySQL" track.
Kevin Lozandier
Courses Plus Student 53,747 PointsHampton Paulk: Any update?
Hampton Paulk
5,093 PointsHowdy Kevin Lozandier, I can reproduce your issue when doing a scratch install with the demo files you mentioned. So that is a good start.
The current way that the file structure is set up it is expecting you to be working from localhost/ or any hostname that is a root. What I mean to say here is you will have an issue if you try to run the site from localhost/shirts4mike/.
The simple solution, and one you need to know for the future, is how to set up virtual hosts on apache.
here are two external links to get you down the road to success. If you need more help please let me know and I will be happy to assist.
Adding a Virtual Host in XAMPP
I tried this on Windows 8, and modifying the hosts file was a bit more challenging, but here is a link to dealing with that.
Modifying Hosts File on Windows 8
I went with the "run as administrator" option