im developing a MVC app in php using wamp & codeigniter in windows 7. the app works without any issue.
i'm totally new to linux and ubuntu.
but i need to host this in ubuntu linux machine. i have used <php include ('/../footer.php); ?>
in windows wamp and it's working.
once i upload to ubuntu lamp. i'm getting include ('/../footer.php) failed to open stream
i tried searching in the net but couldnt get a solution.
how to solve this.
Drop the leading /
and change your includes to
include("../footer.php");
the leading / means from the root of the file system.
You are digging below the root and there just ain't nothing there.
Another thing to beware of when dealing with problems between windows and linux is that on windows ../footer.php is the same as ../Footer.php which is not the case on linux (case sensitive vs case insensitive file systems).
UPDATE
The final solution was to for the relative path for the include into a absolute one by prefixing it with __DIR__
as in ...
include(__DIR__."/../footer.php");