Reputation: 579
I seem to get the 500 error when trying to query the database (mongodb) if I remove the query it display the view fine. From using the quick start guide and other online tutorials I carnt see that I am doing anything wrong.
Model - Posts.php
<?php
namespace app\models;
class Posts extends \lithium\data\Model {
}
Controller - PostsController.php
<?php
/**
* Lithium: the most rad php framework
*
* @copyright Copyright 2015, Union of RAD (http://union-of-rad.org)
* @license http://opensource.org/licenses/bsd-license.php The BSD License
*/
namespace app\controllers;
use app\models\Posts;
class PostsController extends \lithium\action\Controller {
public function index() {
$posts = Posts::find('all', array(
'conditions' => array('author' => 'tom')
));
return $this->render(array('layout' => false));
}
}
?>
View - index.html.php
Contains some text no php as trying to get it working first.
Upvotes: 1
Views: 413
Reputation: 983
Is it possible you don't have MongoDB installed? It's also possible this has something to do with mod_rewrite (AllowOverride comes to mind). Your best bet is to look at your logs.
The location of your logs depends on what you're using. If you're using Apache2 on Ubuntu, it would be located in /var/log/apache2.
Run this in your terminal while refreshing your page:
tail -f /var/log/apache2/error.log
where error.log
is assumed to be the log file name.
As you refresh your page, you should be able to see the error in your terminal.
Upvotes: 0