This error thrown in Symfony 2.6.1 was resolved by going to the app directory of the Symfony site and running the following chmod permission changes. Make sure you have root permissions!
Whoops, looks like something went wrong.
1/1 RuntimeException in ClassCollectionLoader.php line 239: Failed to write cache file “/home/subdomain/public_html/app/dev/cache/classes.php”.
[root@devserver app]# chmod 777 -R cache
[root@devserver app]# chmod 777 -R dev/cache
[root@devserver app]# chmod 777 -R prod/cache
Note: For the “chmod” command, dash R (-R) is recursive, meaning it will change the permissions of all contents in the folder and any files inside any other folders within it. Be careful changing permissions to 777, first try 755, which restricts permissions more safely.