Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CakePHP won't launch [SOLVED]

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
bbagger



Joined: Sat Apr 11, 2009 7:15 pm
Posts: 12

PostPosted: Sat Nov 27, 2010 12:04 pm    Post subject: CakePHP won't launch [SOLVED] Reply with quote

I don't even get the green bars when I try to do the tutorial. I'm using CakePHP 1.3.6 and get a warning on timezone setting, which I ignore for the time being. Worse is this:
Code:
Notice: Trying to get property of non-object in /srv/www/htdocs/cake/libs/cache/file.php on line 248 Fatal error: Call to a member function cd() on a non-object in /srv/www/htdocs/cake/libs/cache/file.php on line 248
What am I doing wrong?

Bent


Last edited by bbagger on Wed Dec 15, 2010 6:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
NormanDunbar



Joined: Wed May 31, 2006 12:57 pm
Posts: 5
Location: West Yorkshire, UK

PostPosted: Tue Dec 14, 2010 4:55 pm    Post subject: CakePHP won't launch Reply with quote

Quote:
I don't even get the green bars when I try to do the tutorial. I'm using CakePHP 1.3.6 and get a warning on timezone setting, which I ignore for the time being. Worse is this:

You must set the timezone, if you don't you get the error you are seeing.

I know this, because I had it too.

I changed mine to "Europe/London" but you can simply un-comment the UTC setting if you wish.

Once you do that, refresh the browser and you will either get a yippee moment, or the next error!

basically, the things you must do are:

* Set the salt
* Set the crypto seed
* Set the timezone
* Make app/tmp directory writable to the webserver user.

Anything less gives errors.

Cheers,
Norm.
_________________
If at first you don't succeed, sky diving is probably not the sport for you.
Back to top
View user's profile Send private message Visit poster's website
bbagger



Joined: Sat Apr 11, 2009 7:15 pm
Posts: 12

PostPosted: Wed Dec 15, 2010 9:26 am    Post subject: Reply with quote

Thanks for the answer.

I'm afraid I have to ask you to explain more specifically how you did set the timezone. Mine is set to Europe/Copenhagen using method 1 in http://www.thegeekstuff.com/2010/09/change-timezone-in-linux/.

Still, I don't understand why a warning can blow up a program. If it does it should be classified as an error. Anyway, the complete output from my attempt is this:
Code:
Warning (2): strtotime() [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 'Europe/Berlin' for 'CET/1.0/no DST' instead [CORE/cake/libs/cache.php, line 570]
Code | Context

$settings   =   array(
   "engine" => "File",
   "path" => "/srv/www/htdocs/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

Notice: Trying to get property of non-object in /srv/www/htdocs/cake/libs/cache/file.php on line 248 Fatal error: Call to a member function cd() on a non-object in /srv/www/htdocs/cake/libs/cache/file.php on line 248
I hope you can shed more light on this.

Bent
Back to top
View user's profile Send private message
NormanDunbar



Joined: Wed May 31, 2006 12:57 pm
Posts: 5
Location: West Yorkshire, UK

PostPosted: Wed Dec 15, 2010 4:49 pm    Post subject: CakePHP won't launch Reply with quote

Evening!

As I'm in the UK and currently on GMT, which is equivalent to UTC, I have a choice:

Edit the file <your_install>/app/config/core.php and either un-comment the line (by removing the // at the start) :

//date_default_timezone_set('UTC');

Or, set it to:

date_default_timezone_set('Europe/London');

Both options cause the warning to vanish, plus, allows the failing "cd" command to work. It's very strange indeed.

It's a PHP 5.3 thing where yo have to tell it the time zone you wish to use rather than relying on the server time zone. makes no sense to me, but there you have it!


Cheers,
Norm.
_________________
If at first you don't succeed, sky diving is probably not the sport for you.
Back to top
View user's profile Send private message Visit poster's website
bbagger



Joined: Sat Apr 11, 2009 7:15 pm
Posts: 12

PostPosted: Wed Dec 15, 2010 6:49 pm    Post subject: Reply with quote

Indeed, it works! After doing as you suggest - except using Europe/Copenhagen - everything fell into place.

Thanks a lot for your help

Bent
Back to top
View user's profile Send private message
NormanDunbar



Joined: Wed May 31, 2006 12:57 pm
Posts: 5
Location: West Yorkshire, UK

PostPosted: Wed Dec 15, 2010 7:24 pm    Post subject: Reply with quote

Evening Bent,

bbagger wrote:
Thanks a lot for your help

Glad to help. I have to confess, I was stuck in exactly the same position as you were just on Monday this week, and once I decided to get rid of the warning message, I found the error message went away as well.

My next problem is that I can't get any of my controllers to work! I just get a 404 page not found. Sigh!

Good luck. Happy christmas.

Cheers,
Norm.
_________________
If at first you don't succeed, sky diving is probably not the sport for you.
Back to top
View user's profile Send private message Visit poster's website
bbagger



Joined: Sat Apr 11, 2009 7:15 pm
Posts: 12

PostPosted: Wed Dec 15, 2010 8:08 pm    Post subject: Reply with quote

Hi Norm

I was very tempted to answer "That makes two of us", but then I discovered that I did not have mod_rewrite loaded. Once I got that done, I got my controller working and am now down to the 'real' coding errors Wink

Merry Christmas to you too.

Bent
Back to top
View user's profile Send private message
NormanDunbar



Joined: Wed May 31, 2006 12:57 pm
Posts: 5
Location: West Yorkshire, UK

PostPosted: Wed Dec 15, 2010 9:13 pm    Post subject: Post subject: CakePHP won't launch Reply with quote

Hi Bent,

bbagger wrote:
...I discovered that I did not have mod_rewrite loaded. Once I got that done, I got my controller working and am now down to the 'real' coding errors Wink


That's the avenue I'm working down now.


Cheers,
Norm.
_________________
If at first you don't succeed, sky diving is probably not the sport for you.
Back to top
View user's profile Send private message Visit poster's website
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast