|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72687 "/" no more pointing to root directory
Submitted: 2016-07-27 14:34 UTC Modified: 2016-07-27 16:15 UTC
From: marc dot lazzaro at st dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 7.0.9 OS: Windows 7
Private report: No CVE-ID: None
 [2016-07-27 14:34 UTC] marc dot lazzaro at st dot com
include ("/test.php") throws this warning:"failed to open stream: No such file or directory in D:\root\subdir\myfile.php"
and also this one: Failed opening '/test.php' for inclusion (include_path='.;D:\root') in D:\root\subdir\myfile.php

This issue appeared when upgrading from PHP 7.0.2 to 7.0.8(22/06/16) keeping php.ini unchanged. I had to replace by include ($_SERVER['DOCUMENT_ROOT']."test.php") to recover normal behavior.

Test script:
include ("/test.php");

include_once ("/test.php");

require_once ("/test.php");


Expected result:
Is this a bug?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-27 16:15 UTC]
-Status: Open +Status: Not a bug
 [2016-07-27 16:15 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

A path like /file.txt is relative to the CWD drive root. Say, if CWD is c:\hello, then \file.txt will resolve to c:\file.txt.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Sep 25 17:05:53 2022 UTC