note 87675 added to function.require
| From: | pedro dot evangelista at gmail dot com | Date: | Tue, 16 Dec 2008 14:23:10 +0000 |
| Subject: | note 87675 added to function.require | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148213@lists.php.net to get a copy of this message | ||
Be careful when using symbolic links, because require will search the real path of the file and not
the path relative to the symbolic link.
Imagine your script A.php resides on directory /a and you create a symbolic link for it on directory
/b/c.
So for the code
<?php
echo realpath("../");
?>
you might expect the directory /b, but actually you get the root directory /.
If you need to include the file /b/B.php inside your A.php, you can't use the following
<?php
require "../B.php";
?>
because it will search the root directory, not the /b directory.
Regards.
----
Server IP: 69.147.83.197
Probable Submitter: 201.87.127.7
----
Manual Page -- http://www.php.net/manual/en/function.require.php
Edit -- https://master.php.net/note/edit/87675
Del: integrated -- https://master.php.net/note/delete/87675/integrated
Del: useless -- https://master.php.net/note/delete/87675/useless
Del: bad code -- https://master.php.net/note/delete/87675/bad+code
Del: spam -- https://master.php.net/note/delete/87675/spam
Del: non-english -- https://master.php.net/note/delete/87675/non-english
Del: in docs -- https://master.php.net/note/delete/87675/in+docs
Del: other reasons-- https://master.php.net/note/delete/87675
Reject -- https://master.php.net/note/reject/87675
Search -- https://master.php.net/manage/user-notes.php