0

Hi there))

Guys please tell me - how to make reference to directory which is on higher level that site root (by php - site is on local machine) -
may by this situation need some aliases in apache .conf file?
As I see the server(apache) don't want to understand path like "..\scripts"....
what should i do?

big thanks in advance))

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by vedro-compota
1

I don't understand why you can't access them.

This is an example of me accessing a file in the computer's root directory (c:\) from localhost (C:\xampp\htdocs\mysite\ folder).

echo file_get_contents('../../text.txt');

Edited by diafol: n/a

Votes + Comments
+++++++++++
0

thanks for answer))

echo file_get_contents('../../text.txt');

yes)) this variant work in my case too )) - I also have access to all directories , but what about to load page - some file.php from (c:\) (when site root as in your example is on C:\xampp\htdocs\mysite\ folder )
what path you'll see in browser?

to be more concrete - i need to make reference , from (for example) on index.php to some file file.php which is on more higher level that site root (as always - index.php is in site root) -
if you can do thit (make such ref) - please post here pease of HTML with link and path which you'll have in browser adress line after visiting file.php

1

The whole point of the web root is that web accessible content should be in the web root or lower.

Content above the web root, e.g the server OS and other important files are protected. You can access these protected files via other scripts within the web directory, but you can never access them via the browser directly.

Votes + Comments
+++++++
0

The whole point of the web root is that web accessible content should be in the web root or lower.

Content above the web root, e.g the server OS and other important files are protected. You can access these protected files via other scripts within the web directory, but you can never access them via the browser directly.

this's full answer)) thank you, blocblue _))

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.