Hi all,
I cannot make a simple application (posts) working.
I have set up EasyPhp 2.0.0.0 and it works fine.I am able to get
everything working. I created a database postdb and created a table as
specified in the tutorial (see below).
I have now set up CakePHP under a folder www/cake. I have updated the
database.php config file;
class DATABASE_CONFIG
<php
{
var $default = array('driver' => 'mysql',
'connect' =>
'mysql_pconnect',
'host' => 'localhost',
'login' => 'root',
'password' => 'root',
'database' => 'postdb',
'prefix' => '');
}
?>
when I try to see if CakePHP framwork is working I do http://localhost/cake/
and I get a rendered page starting with:
CakePHP Rapid Development
Your database configuration file is present.
Cake is able to connect to the database.
http://manual.cakephp.org/view/326/the-cake-blog-tutorial
... etc.
so it works fine.
I then tried to set up the sample available at:
http://manual.cakephp.org/view/326/the-cake-blog-tutorial
I therefore created 3 files:
one in C:\Program Files\EasyPHP 2.0b1\app\models\post.php :
<?php
class Post extends AppModel
{
var $name = 'Post';
}
?>
then in C:\Program Files\EasyPHP 2.0b1\www\cake\app\controllers
\posts_controller.php
<?php
class PostsController extends AppController
{
var $name = 'Posts';
function index()
{
$this->set('posts', $this->Post->findAll());
}
}
?>
then in C:\Program Files\EasyPHP 2.0b1\www\cake\app\views\index.thtml
<h1>Blog posts</h1>
<table>
<tr>
<th>Id</th>
<th>Title</th>
<th>Created</th>
</tr>
<!-- Here's where we loop through our $posts array, printing out
post info -->
<?php foreach ($posts as $post): ?>
<tr>
<td><?php echo $post['Post']['id']; ?></td>
<td>
<?php echo $html->link($post['Post']['title'], "/posts/
view/".$post['Post']['id']); ?>
</td>
<td><?php echo $post['Post']['created']; ?></td>
</tr>
<?php endforeach; ?>
</table>
When I go in my web browser and I try to fetch the URL:
http://localhost/cake/posts/index
or http://localhost/cake/posts/
or http://localhost/cake/posts
i always get a 404 Not Found error
Not Found
The requested URL /cake/posts/index was not found on this server.
I have tried to put the framework at the root level too (i.e.
directories \app \cake \vendors \docs) but the result is the same.
Can someone let me knwo what I can do to make this framework work with
an application that I am creating?
thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---