在Ubuntu 10.4中运行CakePHP时遇到文件权限错误 [英] Facing a file permission error while running CakePHP in Ubuntu 10.4

查看:263
本文介绍了在Ubuntu 10.4中运行CakePHP时遇到文件权限错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照以下步骤安装了CakePHP 2.0框架:

  1。启动终端
2. sudo mkdir / var / www / cakephp
3.sudo cp -r〜/ cakephp / * / var / www / cakephp

更改tmp文件夹权限

  4。 sudo chmod -R 777 cakephp / app / tmp 

启用mod-rewrite

  5。 sudo a2enmod rewrite 

打开文件/ etc / apache2 / sites-enabled / 000- default并更改 AllowOverride无 AllowOverride All

  6。 sudo vim / etc / apache2 / sites-enabled / 000-default 

重新启动Apache

  7。 sudo /etc/init.d/apache2 restart 

我打开我的浏览器和输入的地址 http:// localhost / cakephp / ,我看到这个错误消息:


警告:_cake_core_缓存无法在第310行的/ var / www
/cakephp/lib/Cake/Cache/Cache.php中的文件缓存中写入cake_dev_en-us

警告:_cake_core_缓存无法
在第310行的/var/www/cakephp/lib/Cake/Cache/Cache.php中将'cake_dev_en-us'写入文件高速缓存

警告:/ var / www / cakephp / app / tmp / cache / persistent /在第320行的/ var / www / cakephp
/lib/Cake/Cache/Engine/FileEngine.php中不可写入

警告:/ var / www / cakephp / app / tmp / cache
/ models /在第320行的/var/www/cakephp/lib/Cake/Cache/Engine/FileEngine.php中不可写入

警告:/ var / www / cakephp / app / tmp / cache /不可写入/ var / www / cakephp / lib / Cake
/Cache/Engine/FileEngine.php on line 320



解决方案

命令 sudo chmod -R 777 cakephp / app / tmp 只能使 tmp 可写,你应该使缓存及其子目录可写,否则Cake不能将缓存文件写入tmp中的缓存目录。 / p>

这些目录应该是可写的:

  cakephp / app / tmp / cache 
cakephp / app / tmp / cache / persistent
cakephp / app / tmp / cache / models

$ b b

确保日志目录也是可写的: cakephp / app / tmp / logs


I have installed CakePHP 2.0 framwork using steps below:

1. Start the terminal
2. sudo mkdir /var/www/cakephp
3.sudo cp -r ~/cakephp/* /var/www/cakephp

Change tmp folder permisssion

4. sudo chmod -R 777 cakephp/app/tmp

Enable mod-rewrite

5. sudo a2enmod rewrite

Open file /etc/apache2/sites-enabled/000-default and change AllowOverride None to AllowOverride All

6. sudo vim /etc/apache2/sites-enabled/000-default

Restart Apache

7. sudo /etc/init.d/apache2 restart

I opened my browser and typed address http://localhost/cakephp/ and I seaw this error message:

Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /var/www /cakephp/lib/Cake/Cache/Cache.php on line 310
Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /var/www/cakephp/lib/Cake/Cache/Cache.php on line 310
Warning: /var/www/cakephp/app/tmp/cache/persistent/ is not writable in /var/www/cakephp /lib/Cake/Cache/Engine/FileEngine.php on line 320
Warning: /var/www/cakephp/app/tmp/cache /models/ is not writable in /var/www/cakephp/lib/Cake/Cache/Engine/FileEngine.php on line 320
Warning: /var/www/cakephp/app/tmp/cache/ is not writable in /var/www/cakephp/lib/Cake /Cache/Engine/FileEngine.php on line 320

解决方案

The command sudo chmod -R 777 cakephp/app/tmp only made tmp writable, you should make cache and it's subdirectories writable as well, otherwise Cake can't write the cache files to the cache directory in tmp.

So, these directories should be writable:

cakephp/app/tmp/cache
cakephp/app/tmp/cache/persistent
cakephp/app/tmp/cache/models

Make sure the log directory is writable as well: cakephp/app/tmp/logs.

这篇关于在Ubuntu 10.4中运行CakePHP时遇到文件权限错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆