Original Post
I have run into a relative path issue in PHP i was hoping you may have dealt with yourself before. Here is the problem: File A contains utility function that read/write files. FILE A: ------------------------- function Foo() { fwrite( "./somefile.txt", "bla" ); } File B includes file A for it's functions FILE B: ------------------------- require_once("file_a.php"); // bla bla bla The problem is that the realtive path name used for fwrite/read or any file-interative functions is NOT realative to the PHP file that defines the function, but only to the PHP file that includes the PHP file that defines the function! Essentially, the function Foo() runs differently depending on which file included FILE A. If it was in the same directory, no problem. If it was in any other directory, bad things happen. I can't use full paths either because the web server won't let me write things if i do things that way for some reason. How do i solve this? Thanks for your help.