Hi all.

I've found a really nice looking calender, called CakeCalender that I want to install onto my site, it uses CakePHP http://cakephp.org/. I am having a problem setting this up and was wondering if anyone has used Cake before and if possible they would have a spare couple of minutes to help me install it correctly. I'vefollowed the instructions in the manual and it doesn't seem to work at all.

Dave

Where is your site hosted? The majority of issues that people have with getting Cake setup involve mod_rewrite.

ill try it on my lan and see what happens

are tou using the stable or devel version?

Where is your site hosted? The majority of issues that people have with getting Cake setup involve mod_rewrite.

I am using the free hosting service of my-pace.us as this is a personal site.

I have installed Joomla now after finding jake to try and run the cake apps but still nothing is working.

Dave

Which calendar were you trying to use? and which version of cake?

Pay close attention to the version number here:

How to Install

1. Download CakePHP 1.2
2. Download Cake Calendar
3. Put both directories on your server
4. That's it!

That's from his page.

Hmm, it will work. You have to add the user/administrator yourself, and the style is lacking. But it works... xD

http://testing.clear-mind.com/

http://testing.clear-mind.com/users/login
user: Testing
pass: testing

Ok I've gone through and re-uploaded the directories to the server and I get the following messages

When I try and run Cake I get

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/share/php/cake/libs/view/templates/errors/home.ctp) is not within the allowed path(s): (/tmp/:/var/tmp/:/var/www/errors/:/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs) in /home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cake/cake/basics.php on line 1440

and when I try and run cakecalendar

Warning: require(cake/bootstrap.php) [function.require]: failed to open stream: No such file or directory in /home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cakecalendar/webroot/index.php on line 78

Ok. Find the file called bootstrap.php. It should be in app/config/bootstrap.php. Now edit bootstrap.php and add the following code:

$modelPaths = array('/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cake/app/models');
$viewPaths = array('/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cake/app/views');
$controllerPaths = array('/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cake/app/controllers');

I think the paths are probably correct, but they may not be just right. So you may have to edit them slightly, maybe add the trailing / or whatever.

Let me know what happens.

Bah. The forum is cutting some of it off.
$modelPaths = array('....models');
$controllerPaths = array('...controllers');

Still getting the same errors.

Edit the file /cake/app/config/core.php and change:
define('DEBUG', 2); or it might be define('DEBUG', 1);
to:
define('DEBUG', 0);

You still need a database, once you have a database ready then rename:
/cake/app/config/database.php.default
to:
database.php

then edit the $default = array part so that it reflects the details of your db setup.

Get that far and I'll help you through the last 2-3 things you need to do to get this working

ok I have done that and I can access the main CakePHP page and everything there seems to be ok with the cake installation.

I'm assuming you have uploaded the calendar app.

Ok in /cake/app/sql/ you should find the file cakecalendar.sql. Your host probably has some way to use phpmyadmin via whatever control panel you use yes? Go into phpmyadmin and on the left pick the database you made for cakecalendar. Choose the SQL tab in the right hand pane. Now copy the contents of the file cakecalendar.sql to the textbox (Run SQL query/queries...) and click Go.

One thing to note: It's for the best that this database isnt shared with other apps you may be using.

If you get an error message about syntax then just change all these:
ENGINE=MyISAM DEFAULT CHARSET=latin1;
to this:
ENGINE=MyISAM;
and repeat the copy/paste again.

Now add this function to /cake/app/controllers/users_controller.php

function addUser() {
		$query = "INSERT INTO `users` ( `id` , `username` , `password` )
			VALUES (
				NULL , 'myName', 'myPass'
			)";
		$result = $this->User->query($query);
		if(mysql_error()) {
			die(mysql_error());
		} else {
			die('User successfully added.');
		}
    }

You should comment this function out once you have added your user.

Now the users controller doesn't use any hashing and it probably should xD. So if you are concerned then do the following before you add the user
On line 21, change this:
if(!empty($someone) && $someone == $this->data)
to this:
if(!empty($someone) && $someone == sha1($this->data))
then in the addUser function change:
NULL , 'myName', 'myPass'
to:
NULL , 'myName', '".sha1(myPass)."'

Oh yeah, to add the user you will go to http://mysite.com/users/addUser

You should be all set at this point. If you have any problems just post here.

Ok I've done all that. I have had to edit a lot ofpaths that have been incorrect but now I've come across one that I can't edit. The error message is

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/cake/app/tmp/cache/persistent/class.paths.php) is not within the allowed path(s): (/tmp/:/var/tmp/:/var/www/errors/:/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs) in /home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cake/cake/basics.php on line 1056

however line 1056 reads

    if(file_exists($filename)) {

and I'm not sure as to what this is referencing as class.paths.php is in the directory that it is pointing to.

That is a warning, it doesnt necessarily mean the app is broken. As long as you are not in debug mode you won't see that. So edit /cake/app/config/core.php and change:
define('DEBUG', 2); or define('DEBUG', 1);
to:
define('DEBUG', 0);

If you uploaded the calendar app it probably overwrote core.php file and set it back into debug mode.

Am still getting the same error message come up. Have changed the core.php file in both cake and cakecalendar

Huh?? There should only be 1 core.php to edit!

Describe your folder/directory layout for me.

Edit:

Actually, which directory do you want the calendar installed in? I figured out that you are now trying to install it in /cakecalendar/ so you need to ditch the /cake/ directory cause it will only cause confusion.

Now make sure you edit /cakecalendar/app/config/bootstrap.php and add the following:
$modelPaths = array('/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cakecalendar/app/models');

$viewPaths = array('/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cakecalendar/app/views');

$controllerPaths = array('/home/vol3/myplace.us/daveclissold/daveclissold.com/htdocs/cakecalendar/app/controllers');

Then make sure that /cakecalendar/app/config/database.php has the correct info.
Then make sure that /cakecalendar/app/config/core.php has
define(DEBUG, 0);

Just so we are clear. The calendar and cake should be in the same directory (/cakecalendar/), so the dir structure should be like so

/cakecalendar/
/app/
/config/
/controllers/
/locale/
/models/
etc...
/cake/
/config/
/libs/
/locale/
etc...
etc

Let me know how it goes.

I ran out of time on the other post ;_;

  • /cakecalendar/
    • /app/
      • /config/
      • /controllers/
      • /locale/
      • /models/
      • etc...
    • /cake/
      • /config/
      • /libs/
      • /locale/
      • etc...
  • etc...

I have re-installed everything as per your instructions and am still getting this warning on line 1056.


However when I run it using jake in joomla it sort of works I'm not able to create an admin user section or change the month, but its a start. However I really do not like joomla its a pre-installed CMS on my server so thought I'd test it there.

I should say that in Joomla it displays the calendar but thats it none of the functions are working

hello,
i am also a newbie in cakePHP... It's true it's quite difficult to install cake if your new to it.
I have made as simple tutorial how to instal cakePHP to your local browser. Please follow this link http://marieconbgdlr.wordpress.com/.
Feel free to ask question...
I hope it can help you :)

Try CakeApp.com it provides you with a WYSIWYG cake builder. After building your ER diagram in your browser, you can download the cakephp models and controllers for this SQL diagram.

Pls am new to cakephp, i downloaded cake, unzipped it into ma www directory, i succeeded in setting the database but i can set any pages to run. So can any body how me on where and how i can do this. Change the difficult cakephp page
thanks for your help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.