|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74070 include_path not Working
Submitted: 2017-02-10 02:15 UTC Modified: 2017-02-12 19:31 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: marques0 at gmail dot com Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 7.1.1 OS: Windows Server 2012 R2
Private report: No CVE-ID: None
 [2017-02-10 02:15 UTC] marques0 at gmail dot com
So I'm using php 7.0.6 nts VC14 x64, and everything is working. I decided to upgrade to version 7.1.1. After the upgrade, all include commands from scripts within my include_path stopped working.

I tried to downgrade to version 7.1.0, 7.0.15, 7.0.10, 7.0.7 and all of them had the same problem. Php can't find the files within the include_path.

Just to be sure, I reinstalled version 7.0.6 from the scratch an everything was working again. I even installed version 7.0.5 and it's working with this version also.

My include path in my php.ini is: 
include_path = ".;c:\php;c:\PHPMailer;D:\inetpub\vhosts\\httpdocs" 

my include command in my index script is: 
include "/admin/comum/conectar_mysqli.php";

I'm getting a 500 internal error:

PHP Warning:  include(/admin/comum/conectar_mysqli.php): failed to open stream: No such file or directory in D:\inetpub\vhosts\\httpdocs\index.php on line 5
PHP Warning:  include(): Failed opening '/admin/comum/conectar_mysqli.php' for inclusion (include_path='.;c:\php;c:\PHPMailer;D:\inetpub\vhosts\\httpdocs') in D:\inetpub\vhosts\\httpdocs\index.php on line 5

Test script:
include "/admin/comum/conectar_mysqli.php";

Expected result:
I expect the file used in the include command to be included.

Actual result:
I'm getting a 500 internal error.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-10 21:12 UTC] delgado at nossowebsite dot com dot br
I was able to reproduce the error on my server. include can't find the files inside the include_path after version 7.0.6. when trying to include using include "/relativepath/file.php";
Phpinfo shows the correct value for the include_path
 [2017-02-12 19:31 UTC]
-Status: Open +Status: Not a bug
 [2017-02-12 19:31 UTC]
Thanks for the report. A path like /admin/comum/conectar_mysqli.php with a leading slash or backslash is relative to the current drive. The current drive is the one you see when calling fe getcwd(). There is no connection to the  include_path directive, leading slash will be always a root of the curent drive. More how it looks like, it is some environment change happening in the application or on the server, so then the current drive is changed and consequently the files are not found.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 05:01:31 2024 UTC