Possible Duplicate:
PHP: Warning: include failed to open stream no such file or directory on Windows
My main folder is play. It contains config.php and login folder
login folder has a sub folder called ckeditor and it contains sub folder _samples. It has my php file selectnew.php
I want to include config.php to selectnew.php.
I have set path as follows:
include('play\config.php');
also I have tried
include('play/config.php');
but the following error is the result:
Warning: include(play/config.php) [function.include]: failed to open stream: No such file or directory in D:\wamp\www\play\logins\ckeditor\_samples\selectnew.php on line 7
Warning: include() [function.include]: Failed opening 'play/config.php' for inclusion (include_path='.;C:\php5\pear') in D:\wamp\www\play\logins\ckeditor\_samples\selectnew.php on line 7
my folders
play folder
--config.php
logins folder
ckeditor folder
_samples folder
selectnew.php
You have to go 2 folders up from your current directory (assuming your _samples contains your selectnew.php)
..or you can use this approach to traverse from root folder
By the way you code doesn’t work because you are using relative path to your current file directory. So basically, when you do include(“play/config.php”) the code will try to include this file
which doesn’t existed.