Bug #74070 [Opn->Nab]: include_path not Working
Edit report at https://bugs.php.net/bug.php?id=74070&edit=1
ID: 74070
Updated by: ab@php.net
Reported by: marques0 at gmail dot com
Summary: include_path not Working
-Status: Open
+Status: Not a bug
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows Server 2012 R2
PHP Version: 7.1.1
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2017-02-10 21:12:57] 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-10 02:15:58] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74070&edit=1
Thread (3 messages)