ubuntu - CakePHP 错误 : cake_core_ cache was unable to write 'cake_dev_en-us' on Ubuntu 14. 04

标签 ubuntu cakephp lamp

当我在本地主机 Ubuntu 14.04 (LAMP) 上运行我的 CakePHP 应用程序时,出现此错误:

Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /var/www/html/tmc/lib/Cake/Cache/Cache.php on line 328

Warning: /var/www/html/tmc/app/tmp/cache/persistent/ is not writable in /var/www/html/tmc/lib/Cake/Cache/Engine/FileEngine.php on line 385

Fatal error: Uncaught exception 'CacheException' with message 'Cache engine "_cake_core_" is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct' in /var/www/html/tmc/lib/Cake/Cache/Cache.php:186 Stack trace: #0 /var/www/html/tmc/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /var/www/html/tmc/app/Config/core.php(386): Cache::config('_cake_core_', Array) #2 /var/www/html/tmc/lib/Cake/Core/Configure.php(72): include('/var/www/html/t...') #3 /var/www/html/tmc/lib/Cake/bootstrap.php(431): Configure::bootstrap(true) #4 /var/www/html/tmc/app/webroot/index.php(97): include('/var/www/html/t...') #5 {main} thrown in /var/www/html/tmc/lib/Cake/Cache/Cache.php on line 186

我不确定问题出在哪里。我尝试了 sudo chmod 775/var/www/html/tmc/lib/Cake/Cache/Engine/FileEngine.php 命令,但它没有解决问题。

最佳答案

如果您以 www-data 用户身份运行 apache 或 nginx (fast-cgi),该用户应该是文件的所有者:

cd /var/www/html/tmc/app;

find tmp -type d -print0 | xargs --no-run-if-empty -0 chmod 2755;
find tmp -type f -print0 | xargs --no-run-if-empty -0 chmod 0644;

chown -R www-data:www-data tmp;

关于ubuntu - CakePHP 错误 : cake_core_ cache was unable to write 'cake_dev_en-us' on Ubuntu 14. 04,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37522190/

相关文章:

python - --extra-index-url 在 python requirements.txt 中不起作用

ubuntu - 如何在 mosquitto broker 的 bridg.conf 文件中提及 will 消息设置

php - 将查询结果从灯组传输到另一个灯组

amazon-ec2 - 如何设置和提供类似失败鲸鱼的服务器过载页面?

PHP MySQL 选择长度错误

ruby - 在 ruby​​ 中调用 bash 时如何提供 key

c++ - SFML 代码完成不适用于 Ubuntu 14.04 上的 Code::Blocks 13.12

php - 在 JQuery 中从 Controller 检索值

php - 如何定义表记录组之间的关系?

mysql - SQL 请求无法正常工作