CakePHP unable to write to certain files

2019-06-15 05:32发布

问题:

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.

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.

回答1:

As Wooble points out the app/tmp folder needs to be writeable by your webserver user.

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.

If you're new to Cake then have a look at the tutorial on the manual site http://book.cakephp.org ...



回答2:

Ensure you has folder: app/tmp/

and have the sub folder structure like:

tmp/

--/cache

--/logs

--/sessions

--/tests

Then, check the web users' permission on these folder.



回答3:

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.



回答4:

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.