php.net |  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
Votes:2
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marques0 at gmail dot com
New email:
PHP Version: OS:

 

 [2017-02-10 02:15 UTC] marques0 at gmail dot com
Description:
------------
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\visioneonline.com.br\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\visioneonline.com.br\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\visioneonline.com.br\httpdocs') in D:\inetpub\vhosts\visioneonline.com.br\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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] ab@php.net
-Status: Open +Status: Not a bug
 [2017-02-12 19:31 UTC] ab@php.net
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.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 12:01:29 2024 UTC