Bug #74916 [Opn->Fbk]: include path takes / as being user's home dir
| From: | requinix@php.net | Date: | Thu, 13 Jul 2017 05:24:54 +0000 |
| Subject: | Bug #74916 [Opn->Fbk]: include path takes / as being user's home dir | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210036@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74916&edit=1
ID: 74916
Updated by: requinix@php.net
Reported by: jmichae3 at yahoo dot com
Summary: include path takes / as being user's home dir
-Status: Open
+Status: Feedback
Type: Bug
Package: Unknown/Other Function
Operating System: nix
PHP Version: 7.1.7
Block user comment: N
Private report: N
New Comment:
Are you running in a chroot-ed environment?
> not the html web directory you put your html files into.
It would not do that anyways. /somefile.php will be relative to the root of the filesystem, but if
you're in a chroot then "root of the filesystem" will be different from the actual
root.
> why not a separate command like include_webhome or include_webdir
Add four more of those functions? No thank you. Use $_SERVER["DOCUMENT_ROOT"].
Previous Comments:
------------------------------------------------------------------------
[2017-07-13 04:12:11] jmichae3 at yahoo dot com
Description:
------------
include "/somefile.php";
pulls in a file from the home directory on the server (login root dir), not the html web directory
you put your html files into.
Test script:
---------------
include "/somefile.php";
Expected result:
----------------
should include from web root
(unless you want to run php as a general scripting language for general tasks - why not a separate
command like include_webhome or include_webdir?)
Actual result:
--------------
includes from root dir, which on windows would be c:\
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74916&edit=1