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 Contact Form & Sending Email POST Route & Data

Michal Broniewicz
Michal Broniewicz
6,681 Points

Slim application Error: Unable to write in the cache directory

Yesterday everything was working fine. All pages of my website are working but this one is not. Error looks like:

Type: RuntimeException

Message: Unable to write in the cache directory (/home/treehouse/workspace/cache/3f/11).

File: /home/treehouse/workspace/vendor/twig/twig/lib/Twig/Environment.php

Line: 1278

As i was reading thru most people talk about premission issue.. But why it stopped working while i was not even editing code since it worked. Anyone could help?

simon iribarren
simon iribarren
7,909 Points

Same problem! did you fix it??

2 Answers

I'd suggest reporting that to Treehouse Support directly. Sounds like a bug, perhaps they were working on Workspaces?

Zeljko Porobija
Zeljko Porobija
11,491 Points

I suppose that somewhere in your index.php you have a block like this: ```$view = $app->view(); $view->parserOptions = array( 'debug' => true, 'cache' => dirname(FILE) . '/cache' );

Just delete the line  ```'cache' => dirname(__FILE__) . '/cache'```
That was my problem, we copied the code from SLIM (and it was a sort of different code than it was during the
making of this tutorial