php CakePHP 无法写入某些文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9379899/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CakePHP unable to write to certain files
提问by 001221
I am starting to develop a website using CakePHP for my framework, I've literally just started and have already encountered errors, I can't work about what they mean.
我开始使用 CakePHP 为我的框架开发一个网站,我实际上刚刚开始并且已经遇到错误,我无法理解它们的含义。
Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/lib/Cake/Cache/Cache.php on line 310
Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/lib/Cake/Cache/Cache.php on line 310
Warning: /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/app/tmp/cache/persistent/ is not writable in /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/lib/Cake/Cache/Engine/FileEngine.php on line 320
Warning: /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/app/tmp/cache/models/ is not writable in /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/lib/Cake/Cache/Engine/FileEngine.php on line 320
Warning: /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/app/tmp/cache/ is not writable in /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/lib/Cake/Cache/Engine/FileEngine.php on line 320
I am also getting an error about the following:
我还收到有关以下内容的错误:
Notice (1024): Please change the value of 'Security.salt' in app/Config/core.php to a salt value specific to your application [CORE/Cake/Utility/Debugger.php, line 717]
Notice (1024): Please change the value of 'Security.cipherSeed' in app/Config/core.php to a numeric (digits only) seed value specific to your application [CORE/Cake/Utility/Debugger.php, line 721]
Warning (512): _cake_core_ cache was unable to write 'file_map' to File cache [CORE/Cake/Cache/Cache.php, line 310]
Any help would be much appreciated by all.
任何帮助都会受到所有人的赞赏。
采纳答案by Andy
As Wooble points out the app/tmp folder needs to be writeable by your webserver user.
正如 Wooble 指出的那样,您的网络服务器用户需要可以写入 app/tmp 文件夹。
To correct the other two errors you should edit the app/Config/core.php file as suggested in the errors. Cake ships with default values which should be changed so that not every Cake project has the same security values. If you open that file you will see instructions in the comments.
要纠正其他两个错误,您应该按照错误中的建议编辑 app/Config/core.php 文件。Cake 附带了默认值,应该对其进行更改,以便并非每个 Cake 项目都具有相同的安全值。如果您打开该文件,您将在注释中看到说明。
If you're new to Cake then have a look at the tutorial on the manual site http://book.cakephp.org...
如果您是 Cake 的新手,请查看手册站点http://book.cakephp.org上的教程...
回答by KingBowen
Ensure you has folder: app/tmp/
确保您有文件夹:app/tmp/
and have the sub folder structure like:
并具有子文件夹结构,如:
tmp/
温度/
--/cache
--/缓存
--/logs
--/日志
--/sessions
--/会话
--/tests
--/测试
Then, check the web users' permission on these folder.
然后,检查 Web 用户对这些文件夹的权限。
回答by Marc B
This directory: /Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/app/tmp/cache
needs to be made writeable by whatever user ID your webserver is running under. You don't specify which OS you're on, so can't tell you how to do that specifically.
此目录:/Applications/XAMPP/xamppfiles/htdocs/evolvidsnew/app/tmp/cache
需要由您的网络服务器运行的任何用户 ID 设置为可写。您没有指定您使用的操作系统,因此无法具体告诉您如何执行此操作。
回答by Pratik
go to your APPLICATION_PATH/app/config/core.php file. and find the "Security.salt" and 'Security.cipherSeed' . after that please change the value of both. then you will get solution.
转到您的 APPLICATION_PATH/app/config/core.php 文件。并找到 "Security.salt" 和 'Security.cipherSeed' 。之后,请更改两者的值。然后你会得到解决方案。