I am trying to install sitecake, I followed all the instructions by adding <?php include "sitecake/server/sitecake_entry.php"; ?>
on the top of the page and classes to the divs that I want to be edited.
The problem is, when I add <?php include "sitecake/server/sitecake_entry.php"; ?>
my PHP stops working, why is that? what I am doing wrong?
For example, here is one of my PHP scripts that is added to the pages using PHP include:
<!--add class .active to current page-->
<?php
$directoryURL = $_SERVER['REQUEST_URI'];
$path = parse_url($directoryURL, PHP_URL_PATH);
$components = explode('/', $path);
$currentPage = preg_replace("/\\.[^.\\s]{3,4}$/", "", end($components));
if ($currentPage == "") {
$currentPage = "index";
}
function href($url) {
global $currentPage;
$path = explode('/', $url);
$page = preg_replace("/\\.[^.\\s]{3,4}$/", "", end($path));
echo 'href="' . $url . '" ';
if ($page == $currentPage) {
echo 'class="active"';
}
}
?>
Here is the error I get when I use error_reporting(E_ALL):
Fatal error: Uncaught exception 'Zend_Session_Exception'
with message 'Session must be started before any output has been sent to the browser; output started in /home/approach/public_html/index.php/2'
in /home/approach/public_html/sitecake/server/library/Zend/Session.php:454
Stack trace:
#0 /home/approach/public_html/sitecake/server/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
#1 /home/approach/public_html/sitecake/server/application/services/impl/onesite/Bootstrap.php(21): Zend_Session_Namespace->__construct('Default', false)
#2 /home/approach/public_html/sitecake/server/library/Zend/Application/Bootstrap/BootstrapAbstract.php(666): Bootstrap->_initSession()
#3 /home/approach/public_html/sitecake/server/library/Zend/Application/Bootstrap/BootstrapAbstract.php(619): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('session')
#4 /home/approach/public_html/sitecake/server/library/Zend/Application/Bootstrap/BootstrapAbstract.php(583): Zend_Application_Bootstrap_BootstrapAbstract->_bootstra in /home/approach/public_html/sitecake/server/library/Zend/Session.php on line 454