Bug #74916 [Com]: include path takes / as being user's home dir

From: Date: Thu, 27 Jul 2017 14:36:57 +0000
Subject: Bug #74916 [Com]: include path takes / as being user's home dir
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210369@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 Comment by: jmichae3 at yahoo dot com Reported by: jmichae3 at yahoo dot com Summary: include path takes / as being user's home dir Status: No Feedback Type: Bug Package: Unknown/Other Function Operating System: nix PHP Version: 7.1.7 Block user comment: N Private report: N New Comment: it's probably centos of which I know nothing since it costs money. Previous Comments: ------------------------------------------------------------------------ [2017-07-23 04:22:32] php-bugs at lists dot php dot net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. ------------------------------------------------------------------------ [2017-07-13 05:24:52] requinix@php.net 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"]. ------------------------------------------------------------------------ [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

« previous php.bugs (#210369) next »