Updating CakePHP II

Published on and tagged with cakephp  problem  tip

Ok, after solving my first problem, I got very similar warnings:

Warning: file_put_contents(/home/dho/projects/myproject/tmp/cache/models/dbomysql_companies) [function.file-put-contents]: failed to open stream: Permission denied in /home/dho/projects/cake/cake/basics.php on line 751

That was easy to fix, I had to set the “write”-Permission for the user used by Apache (on Linux this means to use the following command: chmod -R 777 /applicationcontext/app/tmp).

Update 2008-03-02: Adding the chmod command to make the tmp folder writable, thanks to Juan!

10 comments baked

  • Matt

    I get this:

    Warning: file_put_contents(/Users/mattnewb/Sites/cake-1.1/app/tmp/cache/models/default_test_list) [function.file-put-contents]: failed to open stream: Permission denied in /Users/mattnewb/Sites/cake-1.1/cake/basics.php on line 936

    Any ideas?

  • cakebaker

    @Matt: The “tmp” folder and its subfolders have to be writable by the webserver.

    HTH

  • april

    this helped me, thank you!

  • Paolo

    I have a similar problem, I get

    /www/admin/app/tmp/cache/models/default_myModel

    failed to open stream: Permission denied in /www/vendors/cake/cake/basics.php on line 936

    Any help?

  • cakebaker

    @Paolo: See my answer to Matt.

    HTH

  • Juan

    I am having the same problem, now how do I make the “tmp” folder and its subfolders be writable by the webserver?

    ty, Juan

  • Juan

    Never mind…the /tmp folder is inside the PHP application you’re currently working on…chmod -R 777 /applicationcontext/app/tmp, this will recursively change the permissions in the /tmp folder and it’s children..thanks HTH

  • cakebaker

    @Juan: Thanks for your comment. My bad I didn’t describe it better :| I updated the article accordingly.

  • Jesse

    On Leopard:
    sudo chgrp -R _www tmp/ && sudo chmod -R 775 tmp/

  • cakebaker

    @Jesse: Thanks for your hint!

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License