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 Dependency Management Namespacing

Elena Paraschiv
Elena Paraschiv
9,938 Points

Server error 500

"The website encountered an error while retrieving http://port-80-v822ytn8w0.treehouse-app.com/. It may be down for maintenance or configured incorrectly."

I am getting this error when I try to preview the code. Any info would would be appreciated. I just did some changes in Chrome before this happened.

Elena Paraschiv
Elena Paraschiv
9,938 Points
<?php

require __DIR__ . '/vendor/autoload.php';
 date_default_timezone_set('Europe/Stockholm');

$log = new Monolog\Logger('name');
$log->pushHandler(new Monolog\Handler\StreamHandler('app.log', Monolog\Logger::WARNING));
$log->addWarning('Foo');



echo "Hello world!";

?>

1 Answer

kabir k
PLUS
kabir k
Courses Plus Student 18,036 Points

Hi Elena,

I don't know if you're still having this issue. On the code line:

$log->pushHandler(new Monolog\Handler\StreamHandler('app.log', Monolog\Logger::WARNING));

try changing, 'app.log' to 'app.txt'

as Hampton pointed out in the 'Autoloading' video, treehouse has not yet been configured to use .log files

Hope this helps.

kabir