"Failed to open stream" while compiling cache for dev environment

497 views Asked by At

I have a symfony application, were i need to clear the cache after every request. If i don't, i get this error:

Warning: fopen(C:\Users\martin.schimmel\phpStormProjects\purchasing-service\app\cache\dev\a3\60\0e\22\65\9f\c0\df\41\0d\44\52\55\23\48\8d\1e\aa\f4\6f\da\26\ad\10\44\2a\cc\9c\53\bd\c1\fe\[2e0948568c26a37fe9806a0acd4620353dda73e5798fe15581da921bab03d352][1].doctrinecache.data): failed to open stream: Invalid argument"

Because the filename ends in doctrinecache.data, i thought it was doctrine caching, but using commands:

app/console doctrine:cache:clear-metadata 
app/console doctrine:cache:clear-query  
app/console doctrine:cache:clear-result 

to clear doctrine's cache does not work. I really need to remove the cache folder every time. I also have reason to believe it only happens on my Windows machine. We have a dev server running linux that doesn't have this problem.

Can someone at least tell me what the cause is of these folders?

1

There are 1 answers

1
Petr Jaša On

I had the same problem. I found out that it is caused by filepath length limitation in Windows.

According to Microsoft: The traditional Windows API limits path names to 260 characters, even for applications developed for the latest version.

For more details see