在Ubuntu 10.4中运行CakePHP时面临文件权限错误

前端之家收集整理的这篇文章主要介绍了在Ubuntu 10.4中运行CakePHP时面临文件权限错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经使用以下步骤安装了CakePHP 2.0框架:
1. Start the terminal
2. sudo mkdir /var/www/cakePHP
3.sudo cp -r ~/cakePHP/* /var/www/cakePHP

更改tmp文件夹permisssion

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

启用mod-rewrite

5. sudo a2enmod rewrite

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

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

重新启动Apache

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

我打开浏览器并键入地址http://localhost/cakephp/,并且我删除了这个错误信息:

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

命令sudo chmod -R 777 cakePHP / app / tmp只使tmp可写,您应该使缓存和它的子目录也可写,否则Cake不能将缓存文件写入tmp中的缓存目录.

所以这些目录应该是可写的:

cakePHP/app/tmp/cache
cakePHP/app/tmp/cache/persistent
cakePHP/app/tmp/cache/models

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

猜你在找的Ubuntu相关文章