Solved

Cannot run app on CakePHP [warning (512)]

Posted on 2014-07-31
7
1,541 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
Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

863 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

26 Experts available now in Live!

Get 1:1 Help Now