Trouble deploying app with cakephp

I have the cakephp directory which I renamed to ‘cake’ in /srv/www/htdocs. Then inside htdocs is also the app with the directories - controllers, models, views, and webroot. How do I successfully configure all this?

Thanks.

I’m thinking that my cakephp is not configured correctly. I get this at my cakephp page

Warning (512): /srv/www/htdocs/cake/app/tmp/cache/ is not writable [CORE/cake/libs/cache/file.php, line 267]
Code

    if ($this->_init && !is_writable($this->settings'path'])) {
        $this->_init = false;
        trigger_error(sprintf(__('%s is not writable', true), $this->settings'path']), E_USER_WARNING);

FileEngine::__active() - CORE/cake/libs/cache/file.php, line 267
FileEngine::init() - CORE/cake/libs/cache/file.php, line 94
Cache::_buildEngine() - CORE/cake/libs/cache.php, line 151
Cache::config() - CORE/cake/libs/cache.php, line 126
include - APP/config/core.php, line 302
Configure::__loadBootstrap() - CORE/cake/libs/configure.php, line 392
Configure::getInstance() - CORE/cake/libs/configure.php, line 52
include - CORE/cake/bootstrap.php, line 38
require - APP/webroot/index.php, line 76
[main] - CORE/index.php, line 55

Warning: date() :]PHP: Manual Quick Reference](http://php.net/function.date) It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Kuala_Lumpur’ for ‘MYT/8.0/no DST’ instead in /srv/www/htdocs/cake/cake/libs/log/file_log.php on line 71

Warning (2): strtotime() :]PHP: Manual Quick Reference](http://php.net/function.strtotime) It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Kuala_Lumpur’ for ‘MYT/8.0/no DST’ instead [CORE/cake/libs/cache.php, line 570]
Code | Context

$settings = array(
“engine” => “File”,
“path” => “/srv/www/htdocs/cake/app/tmp/cache/persistent/”,
“prefix” => “cake_core_”,
“lock” => false,
“serialize” => true,
“isWindows” => false,
“duration” => “+10 seconds”,
“probability” => 100
)

strtotime - [internal], line ??
CacheEngine::init() - CORE/cake/libs/cache.php, line 570
FileEngine::init() - CORE/cake/libs/cache/file.php, line 81
Cache::_buildEngine() - CORE/cake/libs/cache.php, line 151
Cache::config() - CORE/cake/libs/cache.php, line 126
Configure::__loadBootstrap() - CORE/cake/libs/configure.php, line 421
Configure::getInstance() - CORE/cake/libs/configure.php, line 52
include - CORE/cake/bootstrap.php, line 38
require - APP/webroot/index.php, line 76
[main] - CORE/index.php, line 55

Warning: date() :]PHP: Manual Quick Reference](http://php.net/function.date) It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Kuala_Lumpur’ for ‘MYT/8.0/no DST’ instead in /srv/www/htdocs/cake/cake/libs/log/file_log.php on line 71

Warning (512): /srv/www/htdocs/cake/app/tmp/cache/persistent/ is not writable [CORE/cake/libs/cache/file.php, line 267]
Code

    if ($this->_init && !is_writable($this->settings'path'])) {
        $this->_init = false;
        trigger_error(sprintf(__('%s is not writable', true), $this->settings'path']), E_USER_WARNING);

FileEngine::__active() - CORE/cake/libs/cache/file.php, line 267
FileEngine::init() - CORE/cake/libs/cache/file.php, line 94
Cache::_buildEngine() - CORE/cake/libs/cache.php, line 151
Cache::config() - CORE/cake/libs/cache.php, line 126
Configure::__loadBootstrap() - CORE/cake/libs/configure.php, line 421
Configure::getInstance() - CORE/cake/libs/configure.php, line 52
include - CORE/cake/bootstrap.php, line 38
require - APP/webroot/index.php, line 76
[main] - CORE/index.php, line 55

Warning: date() :]PHP: Manual Quick Reference](http://php.net/function.date) It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Kuala_Lumpur’ for ‘MYT/8.0/no DST’ instead in /srv/www/htdocs/cake/cake/libs/log/file_log.php on line 71

Warning (512): /srv/www/htdocs/cake/app/tmp/cache/models/ is not writable [CORE/cake/libs/cache/file.php, line 267]
Code

    if ($this->_init && !is_writable($this->settings'path'])) {
        $this->_init = false;
        trigger_error(sprintf(__('%s is not writable', true), $this->settings'path']), E_USER_WARNING);

FileEngine::__active() - CORE/cake/libs/cache/file.php, line 267
FileEngine::init() - CORE/cake/libs/cache/file.php, line 94
Cache::_buildEngine() - CORE/cake/libs/cache.php, line 151
Cache::config() - CORE/cake/libs/cache.php, line 126
Configure::__loadBootstrap() - CORE/cake/libs/configure.php, line 428
Configure::getInstance() - CORE/cake/libs/configure.php, line 52
include - CORE/cake/bootstrap.php, line 38
require - APP/webroot/index.php, line 76
[main] - CORE/index.php, line 55

Warning: date() :]PHP: Manual Quick Reference](http://php.net/function.date) It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Kuala_Lumpur’ for ‘MYT/8.0/no DST’ instead in /srv/www/htdocs/cake/cake/libs/log/file_log.php on line 71

Hope this helps. I’m just trying to use cake. And also learning php.

Let me help you step by step.
The 1st error in your code means that the directory is not writable, which means you need to set proper permissions to that directory. I did not use cakephp, that what permissions needed for that specific directory. But you can try 777.
Open terminal and become su - , and now type root password.
Now type:

chmod 777 /srv/www/htdocs/cake/app/tmp/cache/

That will do the trick.

About the date and timezone:
I guess you close the terminal. Now open it again and type:

kdesu kwrite /etc/php5/apache2/php.ini

It will ask for the root password.
Search for this keyword ‘timezone’ with out quotes. If this line is not there or commented out:

date.timezone = Asia/Kuala_Lumpur

If not there, copy from here and paste OR if there uncomment by removing ; in front of it.
Save and quit.

Also for /srv/www/htdocs/cake/app/tmp/cache/persistent/ in terminal when root.

chmod 777 /srv/www/htdocs/cake/app/tmp/cache/persistent/
chmod 777 /srv/www/htdocs/cake/app/tmp/cache/models/

Try it and let us know.
Good luck!

Firstly, thanks for the helpful reply, I really appreciate the help.

Now, I tried all the above and these notices appear.

Notice (1024): Please change the value of ‘Security.salt’ in app/config/core.php to a salt value specific to your application [CORE/cake/libs/debugger.php, line 684]

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/libs/debugger.php, line 688]

Your tmp directory is NOT writable.

The FileEngine is being used for caching. To change the config edit APP/config/core.php

Your database configuration file is NOT present.
Rename config/database.php.default to config/database.php

Again, thanks!

The 1st line said that you need to change the value of a variable in app/config/core.php file. Open that file and go to line 684 and change the value according to your settings etc.

2nd is the same to change value in line 688.

3rd one need proper permissions:

chmod 777 /srv/www/htdocs/cake/app/tmp/

You need to be root in terminal to do the above.

config/database.php.default to config/database.php means you need to change the file name to database.php from database.php.default in config dir.

These are all PHP specific issues, are you new to PHP?

As a matter of fact, I’m quite new to PHP.

Ok. I’m in app/config/core.php and since now I’m all the way here, can anyone tell me what kind of value should it be for the variable?

Configure::write(‘Security.salt’, ‘DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi’);

Thanks.

It’s ok, no problem.

Just a wild guess for the value. Open this file CORE/cake/libs/debugger.php and search salt keyword, copy the value from there and paste it in app/config/core.php file salt variable line. Hope this help.

Just checked. I opened the file /srv/www/htdocs/cake/cake/libs/debugger.php and searched for the value and found that it is the same as in app/config/core.php.

Or should it be the value for the app (fyi it is a friend’s site that I’m experimenting with) that I’m trying to deploy?

Thanks.