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

Code no longer working after refreshing workspace due to being idle too long

Hi,

I was running through this video, got to the end and everything generated correctly, got to the bit where I set the timezone and then I went idle. I came back on 2 hours later, refreshed the workspace as the prompt told me to and now my code no longer works when I run it. I can echo hello world by itself with the autoloader line and I assume the timezone setting would work too but the monolog stuff doesn't work. Maybe I need to run it somehow?

Any suggestions? (Code below)

require 'vendor/autoload.php'; date_default_timezone_set('Europe/London'); $log = new Monolog\Logger('name'); $log->pushHandler(new Monolog\Handler\StreamHandler('app.txt', Monolog\Logger::WARNING));

$log->addWarning('Foo');

echo 'Hello World!';