Solved

Cannot run app on CakePHP [warning (512)]

Posted on 2014-07-31
7
1,495 Views
Last Modified: 2014-09-01
Hello,
I am getting an error while trying to run app:

Warning: SplFileInfo::openFile(/Users/username/Sites/cake/app/tmp/cache/persistent/myapp_cake_core_file_map): failed to open stream: Permission denied in /Users/username/Sites/cake/lib/Cake/Cache/Engine/FileEngine.php on line 355
Warning (512): SplFileInfo::openFile(/Users/username/Sites/cake/app/tmp/cache/models/myapp_cake_model_default_agr_rewp_list): failed to open stream: Permission denied [CORE/Cake/Cache/Engine/FileEngine.php, line 355]
Warning (512): SplFileInfo::openFile(/Users/username/Sites/cake/app/tmp/cache/models/myapp_cake_model_default_agr_rewp_list) [splfileinfo.openfile]: failed to open stream: Permission denied [CORE/Cake/Cache/Engine/FileEngine.php, line 355]
Warning (512): SplFileInfo::openFile(/Users/username/Sites/cake/app/tmp/cache/persistent/myapp_cake_core_cake_dev_eng) [splfileinfo.openfile]: failed to open stream: Permission denied [CORE/Cake/Cache/Engine/FileEngine.php, line 355]
Warning (512): SplFileInfo::openFile(/Users/username/Sites/cake/app/tmp/cache/persistent/myapp_cake_core_cake_dev_eng) [splfileinfo.openfile]: failed to open stream: Permission denied [CORE/Cake/Cache/Engine/FileEngine.php, line 355]
Warning (512): _cake_core_ cache was unable to write 'cake_dev_eng' to File cache [CORE/Cake/Cache/Cache.php, line 323]
Warning (512): _cake_model_ cache was unable to write 'default_agr_rewp_list' to File cache [CORE/Cake/Cache/Cache.php, line 323]
---------

Any ideas how to fix it?

Best regards,
F.
0
Comment
Question by:ikealt
  • 4
  • 3
7 Comments
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40234056
yes, you need to make your Cache directory writable.  The manual even has the commands you can run to fix it assuming you're on linux:

http://book.cakephp.org/2.0/en/installation.html#permissions

HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`
setfacl -R -m u:${HTTPDUSER}:rwx app/tmp
setfacl -R -d -m u:${HTTPDUSER}:rwx app/tmp

Open in new window

0
 

Author Comment

by:ikealt
ID: 40234059
Hi, Thanks for it. I am using Mac x OS.
Is it the same in terminal or different?
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
ID: 40234209
Should be the same. But if you need to then just use:

chmod -R 777 app/tmp

In the patent directory. Not ideal to have those permissions but I'm guessing you're just running this locally at the moment given you're running it in your Mac?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:ikealt
ID: 40234213
Yes, you are right. I am running it locally and on my own Mac.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40234219
You may need to use sudo before that chmod command
0
 

Author Comment

by:ikealt
ID: 40297005
Thanks its working!
0
 

Author Closing Comment

by:ikealt
ID: 40297006
Thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now