初めて CakePHP を試しているので、CakePHP の Web サイト (ここ) にあるブログ チュートリアルを実行しようとしています。インデックスページを実行するとすべてが緑色になるため、CakePHP は正しくインストールされています。しかし、最初のコントローラー、モデル、およびビューを追加して、コントローラーのインデックス機能を実行すると、Apache がクラッシュし、続行できなくなります。
MySql で「ブログ」というデータベースを既に作成しています。
これは私のモデル クラスです: (app/Model/Post.php にあります)
<?php
class Post extends AppModel {
}
これは私のコントローラーです: (app/Controller/PostsController.phpにあります)
class PostsController extends AppController {
public $helpers = array('Html', 'Form');
public function index() {
$this->set('posts', $this->Post->find('all'));
}
}
これが私の見解です: (app/View/Posts/index.ctpにあります)
<!-- File: /app/View/Posts/index.ctp -->
<h1>Blog posts</h1>
<table>
<tr>
<th>Id</th>
<th>Title</th>
<th>Created</th>
</tr>
<!-- Here is 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 $this->Html->link($post['Post']['title'],
array('controller' => 'posts', 'action' => 'view', $post['Post']['id'])); ?>
</td>
<td><?php echo $post['Post']['created']; ?></td>
</tr>
<?php endforeach; ?>
<?php unset($post); ?>
</table>
これは私が実行しようとしているURLです:
http://[lclhost]/blog/posts/
http://[lclhost]/blog/ は、メインの CakePhp ページの正しい出力を提供します。
これは私が得るApacheエラーログです:
[Mon Sep 09 17:32:28 2013] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Mon Sep 09 17:32:34 2013] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Sep 09 17:32:34 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Sep 09 17:32:34 2013] [notice] Digest: done
[Mon Sep 09 17:32:35 2013] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8 configured -- resuming normal operations
[Mon Sep 09 17:32:35 2013] [notice] Server built: Dec 10 2008 00:10:06
[Mon Sep 09 17:32:35 2013] [notice] Parent: Created child process 10516
[Mon Sep 09 17:32:35 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Sep 09 17:32:35 2013] [notice] Digest: done
[Mon Sep 09 17:32:36 2013] [notice] Child 10516: Child process is running
[Mon Sep 09 17:32:36 2013] [notice] Child 10516: Acquired the start mutex.
[Mon Sep 09 17:32:36 2013] [notice] Child 10516: Starting 250 worker threads.
[Mon Sep 09 17:32:36 2013] [notice] Child 10516: Starting thread to listen on port 443.
[Mon Sep 09 17:32:36 2013] [notice] Child 10516: Starting thread to listen on port 81.
OS: Windows7
アパッチ/2.2.11 (Win32)
PHP バージョン 5.2.8
私が間違っていることを誰かが知っていますか?