Posted on 2007-07-23
Last Modified: 2012-06-21
Ok, here what I do. I change the  include_path using
$currentInc = get_include_path();
$documentRoot = $_SERVER['DOCUMENT_ROOT'];
$documentRoot = explode('/',$documentRoot);
$documentRoot = join(DIRECTORY_SEPARATOR,$documentRoot);

so what I assume, whenever I use require or require_once, the file will be searched in these directories.
There is a top.php file under /libs/incs/sections directory and index.php file in the root directory. When I try require_once('top.php') I get
Fatal error: require_once() [function.require]: Failed opening required

So if I am adding this dir in the include_path, why it can't find it?

Question by:bilgehanyildirim
    LVL 4

    Accepted Solution

    My suggestion, although this will not solve the problem is..

    echo $currentInc.PATH_SEPARATOR.$pathInc;

    After where you set all the variables and just make sure that it is looking in the correct place for the files.

    Im aware you have probably already tried this but i would be interested to see the results

    Author Comment

    Problem solved. It was just a typo :)))
    Thanks for your time...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now