problem with 'required' from a different directory?
Posted: Wed Sep 01, 2010 6:11 pm
I've got a file we'll call documentroot/affiliate/file1.php. It requires and includes a number of other files in the affiliate directory.
When I run it by itself it runs fine (eg http://www.documentroot/affiliate/file1.php).
When I require it in documentroot/file2.php I get two kinds of errors:
--permission failure with a fwrite function
--"Call to undefined function sqlconnect()" fatal error in one of the files included in file1.php, we'll call "documentroot/affiliate/lib/file4.php".
All the permissions seem the same in documentroot and in documentroot/affiliate. And the database information at the beginning of file4.php all looks right.
Is there some principle about require and include from other directories that I'm missing? Or some other reason these kinds of problems could be arising when I require file1 from within file 2?
Thanks.
When I run it by itself it runs fine (eg http://www.documentroot/affiliate/file1.php).
When I require it in documentroot/file2.php I get two kinds of errors:
--permission failure with a fwrite function
--"Call to undefined function sqlconnect()" fatal error in one of the files included in file1.php, we'll call "documentroot/affiliate/lib/file4.php".
All the permissions seem the same in documentroot and in documentroot/affiliate. And the database information at the beginning of file4.php all looks right.
Is there some principle about require and include from other directories that I'm missing? Or some other reason these kinds of problems could be arising when I require file1 from within file 2?
Thanks.