Strange problem: require_once seems to cache included file

Hello,

I’m having a strange problem. I upload a “banner.php” file on my server using FileZilla. This file is included in index.php. No matter what I do, the changes to banner.php are not reflected in index.php. Yet the file seems to be included correctly. When I cut and paste the content of banner.php into index.php instead of including the file, everything works fine.

It’s as if require_once was caching an older version of banner.php and always including it, which, afaik is not possible.

So I deleted banner.php from my server and completely removed it. But index.php keeps on including it as if it was there. The “old” version, of course.

What could cause this strange issue? Has anyone seen that before? Could it be some javascript that is causing the problem? Or the use of set_include_path()?

Thanks in advance.

-jj. :slight_smile:

I think you need to provide some example code. However, just a shot in the dark, have you tried using include() rather than require_once()? Does it make any difference?

Look carefully at the list of folders which stored in your include_path directive.

It usually looks something like:

“.;/var/php/PEAR/;/var/includes/”

ie contains many directories including the dot (present working directory).

Alternatively use the *nix locate command to find how many instances you have of the include file name “banner.php” – delete all but the fresh one you uploaded.

If you are using APC then flush the cache, you never know.

Try clearing your browser cache and/or checking it on another computer?