php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46431 Include() do not working from command line
Submitted: 2008-10-30 15:02 UTC Modified: 2008-10-30 23:53 UTC
From: info at vlantana dot lt Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.6 OS: Windows XP
Private report: No CVE-ID: None
 [2008-10-30 15:02 UTC] info at vlantana dot lt
Description:
------------
Hello
I upgrade server and PHP from 4.1 to 5.26.
The script with include(../scripts.php) files on webpage is working OK. But the same script from command line doesn't work.
As i understood from command line there has to be absolute path, like c:/directory/script.
On version 4.1 I used relative path.

Reproduce code:
---------------
<?
ini_set('display_errors', 1); 
error_reporting(E_ALL);
include'../vl_web/vl_conn.php';
?>



Expected result:
----------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\PHP>c:\php\php.exe -q c:\web\tmp\in.php
#C:\PHP#PHP Warning:  include(../vl_web/vl_conn.php): failed to open stream: No
such file or directory in C:\web\tmp\in.php on line 6

Warning: include(../vl_web/vl_conn.php): failed to open stream: No such file or
directory in C:\web\tmp\in.php on line 6
PHP Warning:  include(): Failed opening '../vl_web/vl_conn.php' for inclusion (i
nclude_path='.;C:\php5\pear') in C:\web\tmp\in.php on line 6
Warning: include(): Failed opening '../vl_web/vl_conn.php' for inclusion (includ
e_path='.;C:\php5\pear') in C:\web\tmp\in.php on line 6

C:\PHP>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-30 23:53 UTC] jani@php.net
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 http://www.php.net/support.php 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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Nov 30 18:00:01 2025 UTC