Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Building Websites with PHP Contact Form & Sending Email POST Route & Data

Michal Broniewicz
Michal Broniewicz
6,669 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,490 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