I am trying to execute my first application in cakephp, but it's giving an error
Fatal error: Uncaught exception 'CacheException' with message 'Cache
engine _cake_core_ is not properly configured.' in
/opt/lampp/htdocs/CakeTooDoo/lib/Cake/Cache/Cache.php:166 Stack trace:
#0 /opt/lampp/htdocs/CakeTooDoo/lib/Cake/Cache/Cache.php(136): Cache::_buildEngine('_cake_core_') #1
/opt/lampp/htdocs/CakeTooDoo/app/Config/core.php(336):
Cache::config('_cake_core_', Array) #2
/opt/lampp/htdocs/CakeTooDoo/lib/Cake/Core/Configure.php(78):
include('/opt/lampp/htdo...') #3
/opt/lampp/htdocs/CakeTooDoo/lib/Cake/bootstrap.php(171):
Configure::bootstrap(true) #4
/opt/lampp/htdocs/CakeTooDoo/app/webroot/index.php(92):
include('/opt/lampp/htdo...') #5 {main} thrown in
/opt/lampp/htdocs/CakeTooDoo/lib/Cake/Cache/Cache.php on line 166
and two warnings
Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to
File cache in /opt/lampp/htdocs/CakeTooDoo/lib/Cake/Cache/Cache.php on
line 310
Warning: /opt/lampp/htdocs/CakeTooDoo/app/tmp/cache/persistent/ is not
writable in
/opt/lampp/htdocs/CakeTooDoo/lib/Cake/Cache/Engine/FileEngine.php on
line 337
Pleas give me any solution to do my first application with cakephp.
you can use a permissive ownership:
chmod -R 777 app/tmp
A better method is to change group ownership of tmp and everthing below it to www-data ( or whatever group your apache server runs in ) with 'chgrp -R www-data tmp' followed by 'chmod -R 774 tmp' This makes tmp read/write for you and the www-data group but readonly for everyone else
let me know if i can help you more.
The cache folder is not writable according to warning.
open terminal, run sudo chmod 777 /opt/lampp/htdocs/CakeTooDoo -R
Plus, you should reconfigure file permissions, like 775, in real productions.
Related
I looked everywhere on the web and just couldn't find a solution.
I am getting this error:
Warning: fopen(/var/www/html/includes/../log/404/log_2018-04-07.txt): failed to open stream: Permission denied in /var/www/html/vendor/katzgrau/klogger/src/Logger.php on line 167
Fatal error: Uncaught exception 'RuntimeException' with message 'The file could not be opened. Check permissions.' in /var/www/html/vendor/katzgrau/klogger/src/Logger.php:134 Stack trace:
#0 /var/www/html/includes/db_class.php(7204): Katzgrau\KLogger\Logger->__construct('/var/www/html/i...')
#1 /var/www/html/includes/db_class.php(7217): db_class->getLogger('404')
#2 /var/www/html/includes/furl_router.php(55): db_class->logger('404')
#3 /var/www/html/includes/furl_router.php(229): goTo404('no page-data / ...')
#4 /var/www/html/index.php(17): require_once('/var/www/html/i...')
#5 {main} thrown in /var/www/html/vendor/katzgrau/klogger/src/Logger.php on line 134
From what I read here it's a permission issue but I can't figure it out. I granted all permissions from root folder, I have no idea what am I doing wrong.
Check folder write permissions. Maybe the user trying to write the log has no permissions. sudo chmod -R 666 logs gives read and write permissions to all users.
For anyone using Katzgrau\KLogger\Logger and using relative paths to locate the log file, use an absolute path, e.g.:
$logger = new Logger(__DIR__ . '/../../logs');
After reading a bit about another issue I had but with a MySQL function, after exploring, I figured out I should use MySQL version 5.6 while I used version 5.7.
I uninstalled MySQL 5.7 and install 5.6 instead. It solved both the MySQL issue and the issue mentioned above.
I have Fedora18 and was trying to install cakephp . But it shows
Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /var/www/html/cakem2/lib/Cake/Cache/Cache.php on line 323
Warning: /var/www/html/cakem2/app/tmp/cache/persistent/ is not writable in /var/www/html/cakem2/lib/Cake/Cache/Engine/FileEngine.php on line 385
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /var/www/html/cakem2/lib/Cake/Cache/Cache.php:181 Stack trace: #0 /var/www/html/cakem2/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_') #1 /var/www/html/cakem2/app/Config/core.php(374): Cache::config('_cake_core_', Array) #2 /var/www/html/cakem2/lib/Cake/Core/Configure.php(72): include('/var/www/html/c...') #3 /var/www/html/cakem2/lib/Cake/bootstrap.php(175): Configure::bootstrap(true) #4 /var/www/html/cakem2/app/webroot/index.php(94): include('/var/www/html/c...') #5 /var/www/html/cakem2/index.php(41): require('/var/www/html/c...') #6 {main} thrown in /var/www/html/cakem2/lib/Cake/Cache/Cache.php on line 181
Following the answers Similar Question, I have made all the directory and sub-directory writable as shown in . But I am still getting the error ! Whats wrong ?
chown the folders / files so that the user matches the user which httpd or Apache uses to access these files. I don't know the user for fedora, i think its apache or httpd. In ubuntu its www-data.
http://fedoraproject.org/wiki/Administration_Guide_Draft/Apache
I have two config files located in: /etc/svnauth and var/www/svnauth
I have given read, write access to for both files like shown below
chown -R apache:apache /etc/svnauth
chmod -R 770 /etc/svnauth
chown -R apache:apache /var/www/svnauth
chmod -R 770 /var/www/svnauth
When I try to read these two files using pear/Config_Lite, /etc/svnauth always fails. I can successfully read the /var/www/svnauth file
Any reasons for this? What am I missing here
Following is the error message i get:
Fatal error: Uncaught exception 'Config_Lite_Exception_Runtime' with message 'file not readable: /etc/svnauth' in /var/www/html/svnmanager/Config/Lite.php:112 Stack trace: #0 /var/www/html/svnmanager/index.php(60): Config_Lite->read('/etc/svnauth') #1 {main} thrown in /var/www/html/svnmanager/Config/Lite.php on line 112
is open_basedir set in your php.ini? If so, does it contain /etc/?
I am trying to follow the instructions for the cakephp tutorial found here: http://book.cakephp.org/2.0/en/getting-started.html
I uploaded the CakePHP files to my webserver, created the database using MySQL workbench, and created database.php and updated it to point to my MySQL server.
At this point it sounds like I should be able to open up the website in my browser and see something, but instead I get these errors (I have removed the full path):
Warning: _cake_core_ cache was unable to write 'cake_dev_en-us' to File cache in /caketut/lib/Cake/Cache/Cache.php on line 325
Warning: caketut/app/tmp/cache/persistent/ is not writable in /www/premium/med/pediatrics/www.hobmt.umn.edu/htdocs/caketut/lib/Cake/Cache/Engine/FileEngine.php on line 380
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine _cake_core_ is not properly configured.' in /caketut/lib/Cake/Cache/Cache.php:181
Stack trace:
#0 /caketut/lib/Cake/Cache/Cache.php(151): Cache::_buildEngine('_cake_core_')
#1 /caketut/app/Config/core.php(367): Cache::config('_cake_core_', Array)
#2 /caketut/lib/Cake/Core/Configure.php(72): include('/www/premium/me...')
#3 /caketut/lib/Cake/bootstrap.php(177): Configure::bootstrap(true)
#4 /caketut/app/webroot/index.php(92): include('/www/premium/me...')
#5 {main} thrown in /caketut/lib/Cake/Cache/Cache.php on line 181
I tried setting the permissions for the Cache folder located in /caketut/lib/Cake and all subfolders/files to be 0776, and this removes all errors except this one:
Fatal error: Class 'Cache' not found in /caketut/app/Config/core.php on line 361
I tried doing searches but was unsuccessful in finding a solution. I would really appreciate any assistance!
try to chmod the whole script with 0777 permissions .
sudo chmod -R 0777 caketut
I'm trying to run a script using crontab, but I have problems making it work even from the command line. The script runs fine from the browser and it creates some excel files in reports/ folder which is owned by apache. The script file is owned by me: john.
When I try to run the script from the command line, I get the following warnings, and the excel file doesn't create. I've tryed with the full path, but I get the same results.
This is what I got after I try to run the script from command line
public_html]$ php include/tests/mailme.php
PHP Warning: fopen(reports/4-March.xls): failed to open stream: Permission denied in /home/john/public_html/PHPExcel/Shared/OLE/PPS/Root.php on line 90
Warning: fopen(reports/4-March.xls): failed to open stream: Permission denied in /home/john/public_html/PHPExcel/Shared/OLE/PPS/Root.php on line 90
PHP Fatal error: Uncaught exception 'Exception' with message 'Can't open reports/4-March.xls. It may be in use or protected.' in /home/john/public_html/PHPExcel/Shared/OLE/PPS/Root.php:93
Stack trace:
#0 /home/john/public_html/PHPExcel/Writer/Excel5.php(233): PHPExcel_Shared_OLE_PPS_Root->save('reports/...')
#1 /home/john/public_html/include/generate_daily_excel.inc(401): PHPExcel_Writer_Excel5->save('reports/...')
#2 /home/john/public_html/include/tests/mailme.php(41): generateDailyExcel('04-02-2013')
#3 {main}
thrown in /home/john/public_html/PHPExcel/Shared/OLE/PPS/Root.php on line 93
Fatal error: Uncaught exception 'Exception' with message 'Can't open reports/4-March.xls. It may be in use or protected.' in /home/john/public_html/PHPExcel/Shared/OLE/PPS/Root.php:93
Stack trace:
#0 /home/john/public_html/PHPExcel/Writer/Excel5.php(233): PHPExcel_Shared_OLE_PPS_Root->save('reports/...')
#1 /home/john/public_html/include/generate_daily_excel.inc(401): PHPExcel_Writer_Excel5->save('reports/...')
#2 /home/john/public_html/include/tests/mailme.php(41): generateDailyExcel('04-02-2013')
#3 {main}
thrown in /home/john/public_html/PHPExcel/Shared/OLE/PPS/Root.php on line 93
I assume that if I change the owner of reports, the browser version will not be allowed to save. I'm new to linux and rights.
When you run php code from command line. The script runs with your user permission , not with www-data user permissions.
You should run script as root (not recommend) , or instead change the file permissions:
sudo chown yourUser:www-data file
sudo chmod 664 file
And you should do nearly the same with the directory:
sudo chown yourUser:www-data dir
sudo chmod 775 dir
The error is laid out very explicitely for you: "failed to open stream: Permission denied". When you are running this from the command line, you are user "john" (I assume from your home path). Does user "john" have permission to write in the reports directory?
What are the permissions of the actual reports directory?
ls -al /home/john/public_html/reports