我第一次尝试CakePHP所以我正在尝试运行CakePHP网站上的博客教程(Here)。我的CakePHP安装正确,因为在运行索引页面时,我将所有内容都设置为绿色。但是当我添加我的第一个控制器,模型和视图并运行我的控制器的索引功能时,Apache崩溃了,我无法继续。
我已经在MySql上创建了名为“blog”的数据库。
这是我的模型类:(位于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>
这是我正在尝试运行的网址:
的http:// [lclhost] /博客/文章/
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.
操作系统:Windows 7
Apache / 2.2.11(Win32)
PHP Version 5.2.8
有谁知道我做错了什么?
答案 0 :(得分:1)
搜索Parent: child process exited with status 3221225477
并尝试找到的解决方案。
一个常见的似乎是复制一些.dll
个文件。
我个人遇到了一个段错误,我没有找到解决方案(尝试了一切)。我认为这与正则表达式有关。在任何情况下。 Apache / Windows上的PHP有点不稳定。考虑切换到Linux,如果你无法弄明白,它运行得更稳定。