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 Building Websites with PHP Slim Basics & Twig Templates Including & Running Slim

500 internal server error

am using wamp on windows 7 and am keep getting this error: Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

3 Answers

Carlos Zavala
Carlos Zavala
5,284 Points

I had the same problem. I'm in Windows 10 using WAMP Server.

First, the log file is in C:\wamp\logs\apache_error.log

There I found this line "[Mon Aug 24 00:46:07.081320 2015] [core:alert] [pid 7884:tid 1136] [client ::1:50172] C:/wamp/www/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration".As I understood, this mean that the "RewriteEngine" on the .htaccess file wasn't available.

It could be enable on editing the "httpd.conf" file on "C:\wamp\bin\apache\apache2.4.9\conf" if you have apache 2.4.9. It just need to uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line).

Finally, restart WAMP server.

I hope this work for you too. Good luck.

cynnimon
cynnimon
4,001 Points

This has worked perfectly for me! Thank you!

This means an error message was sent before the http header. The first thing a httpd needs is a proper header so your browser can tell what is coming its way.

The only way to see these messages now is to go look on your local disk for a file named error_log (unless configured otherwise but I doubt it), open it and see the last lines. You will see timestamps that will match your errors followed by the messages.

Now where would that file be? Depends where you installed Apache. Go look for the error_log file, if the full folder name has Apache in it, it probably is the right place.

The version of slim used in this video is 2.6 but now when we install the latest version it's 3.1.0. As Hampton said in his second video in this course ("Introducing composer"): 1:25 A change in the major version means that there are changes so great that it will break the existing API..(https://teamtreehouse.com/library/building-websites-with-php/dependency-management/introducing-composer). So used composer require one more time , slim and then 0 and when asked about version constraint to require I added 2.6 and now everything works just fine.