Jump to content

CrashyBang

New Members
  • Posts

    2
  • Joined

  • Last visited

CrashyBang's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. There is an .htaccess file in the blog folder with the following content: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,L] </IfModule> Both: http://mydomain/blog and http://mydomain/blog/index.php return this error: {"type":64,"message":"require_once(): Failed opening required '..\/..\/partials\/errorlogging.php' (include_path='.:\/home\/codio\/.parts\/packages\/php5-apache2\/5.5.15\/lib\/php')","file":"\/home\/codio\/workspace\/blog\/views\/index.php","line":1} It is a Codio project so as far as I can tell it would be like my own server (not shared). Cheers, Otis.
  2. I am working from Cockpit CMS and I am trying to create a blog using this tutorial. Directory structure (simplified): +blog -index.php + views -index.php -article.php -index.php +partials -constants.php -top.php blog/index: <?php require_once("../partials/errorlogging.php"); ?> <?php require_once("../partials/constants.php"); ?> <?php require_once("../partials/top.php"); ?> <?php $app = new Lime\App(); // bind routes $app->bind("/", function() use($app) { $posts = collection('blog')->find(["public"=>true])->sort(["created"=>1])->toArray(); return $app->render('views/index.php', ['posts' => $posts]); }); $app->bind("/article/:id", function($params) use($app) { $post = collection('blog')->findOne(["_id"=>$params['id']]); return $app->render('views/article.php', ['post' => $post]); }); $app->run(); ?> <?php require_once("../partials/bottom.php"); ?> blog/views/index.php: <?php require_once("../../partials/errorlogging.php"); ?> <?php require_once("../../partials/constants.php"); ?> <?php require_once("../../partials/top.php"); ?> <?php foreach ($posts as $post): ?> <h2><a href="<?php $this->route('/article/'.$post['_id']);?>"><?php=$post['title'];?></a></h2> <?php endforeach; ?> <?php require_once("../../partials/bottom.php"); ?> blog/views/article.php: <?php require_once("../../partials/errorlogging.php"); ?> <?php require_once("../../partials/constants.php"); ?> <?php require_once("../../partials/top.php"); ?> <h1><?php=$post['title'];?></h1> <p> <?php=$post['content'];?> </p> <?php require_once("../../partials/bottom.php"); ?> Now at the moment if I go to domain.name/blog/ I receive this error: {"type":64,"message":"require_once(): Failed opening required '..\/..\/partials\/errorlogging.php' (include_path='.:\/home\/codio\/.parts\/packages\/php5-apache2\/5.5.15\/lib\/php')","file":"\/home\/codio\/workspace\/blog\/views\/index.php","line":1} However I know for a fact that it is not a problem with the require methods because if I run this code inblog/index.php: <?php require_once("../../partials/errorlogging.php"); ?> <?php require_once("../../partials/constants.php"); ?> <?php require_once("../../partials/top.php"); ?> <?php $app = new Lime\App(); $app->bind("/", function() { return "Hello World!"; }); $app->run(); ?> <?php require_once("../../partials/bottom.php"); ?> There is absolutely no errors on the page or console, and "Hello World" is printed to the screen, so it is to do with the blog/index.php syntax but I have no idea where the problem is...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.