Work with dir from www-user and from console in Mac OS x
===

I install Symfony and do:
   
    chmod -R 777 app/cache app/log

Open from browser - all works great! When go to console and do: 
   
    php app/console cache:clear

and get error what i have not primission to delete file. Ok, i l'll do it with sudo:

    sudo php app/console cache:clear

Great! But...

In browser i get:

    RuntimeException: Failed to write cache file

Please

