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


Michal Broniewicz
Michal Broniewicz
6,681 Points

File could not be written, Unable to create the cache directory

I am trying to create website using composer and slim (I follow Building websites with PHP course) and everything was working fine till day when one of the pages stopped working saying its "Unable to create the cache directory". Other pages are working correctly.

Then I tried to update composer thru workspace and it says that ".../cache/composer/composer.phar File could not be written"

It looks like there is no premission of adding/editing anything on the server but it was working fine before and i created few pages that are working correctly. I can give more details about errors or files if needed. If anyone could help me I will be really thankful. I dont know how to fix that and Im stuck..

1 Answer

Have you tried running the same command using 'sudo'?