Re: windows path problem: failed to open stream: No such file or directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It sounds like a traversal issue. Have you tried specifying an absolute path like this:

require_once "C:\\Program Files\\xampp-php\\xampp\\htdocs\\inside\\classes\\folder1\\ThisClass.php";

To see if it works? The double slashes are not in error.. I have some sites under Apache on Windows that pull files from or write files to non web-accessible directories and I have to specify double forward slashes in the absolute path order to make them work. Cheers.

Armando

trystano@xxxxxxx wrote:
Can you locate the included file via absolute path? I.E. "/folder2/someclass.php" Tryst -----Original Message-----
 From: jazzyy@xxxxxxxxx
 To: php-windows@xxxxxxxxxxxxx
 Sent: Sat, 16 Dec 2006 9.53PM
 Subject:  windows path problem: failed to open stream: No such file or directory
Hi list I have a problem that I simply cannot understand and that is literaly driving me mad! I am using xampp on a windows XP professional with SP2. I have a site structure similar to this in htdocs: + site_name + classes + folder1 + folder2 + ... other folders - .htaccess - .. other files Now the classes folder contains classes that I have defined. I include this directive in one of the classes [say ThisClass.php] in a folder [say folder1] to require a class in another folder [I have included the top level classes folder in the .htaccess file for the site]: require_once "../folder2/SomeClass.php"; I get this error: *Warning*: main(../folder2/SomeClass.php): failed to open stream: No such file or directory in *C:\Program Files\xampp-php\xampp\htdocs\inside\classes\folder1\ThisClass.php* on line * 3* *Fatal error*: main(): Failed opening required 'SomeClass.php' (include_path='.;C:/Program Files/xampp-php/xampp/htdocs/inside/classes/;../') in *C:\Program Files\xampp-php\xampp\htdocs\inside\classes\folder1\ ThisClass.php* on line *3* ** However other classes inside the folder are found without any problems. It's when I have to traverse the folder structure to find the required files in other folder that I have these problems. I have trolled the net endlessly and all the mentions to this problem are related to software packages [such as cms and others]. These problems are quite easily solved by reinstalling th application but as is obvious i cannot simply do that. I need some help with this. Can you please help me out here? Thanks

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux