#23456 [Opn->WFx]: CLI version path handling makes includes non-portable

From: Date: Sat, 03 May 2003 00:30:49 +0000
Subject: #23456 [Opn->WFx]: CLI version path handling makes includes non-portable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38978@lists.php.net to get a copy of this message
ID: 23456 Updated by: derick@php.net Reported By: don at lekei dot ca -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: ANY PHP Version: 4.3.1 New Comment: Just chdir to the working directory then, or use the CGI for command line scripting which does the chdir for you. It was intended to work like this, and it will not change. Derick Previous Comments: ------------------------------------------------------------------------ [2003-05-02 18:08:01] don at lekei dot ca Making the working directory relative to the invocation path improves the ability to write filters but renders all existing scripts, libraries and classes unusable for command-line applications. A configuration option should be added to make includes relative to the script path instead of the working directory so libraries and classes can be used in a portable manner. ------------------------------------------------------------------------ [2003-05-02 17:24:51] helly@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php CLI was EXPERIMENTAL in 4.2.x and RTFM. ------------------------------------------------------------------------ [2003-05-02 17:15:50] don at lekei dot ca When a script has an include statement such as: include_once("../includes/session.php"); (This file works with 4.2.3) It fails to find the include file because it is not searching relative to the script directory. This seems similar to other reported bugs but the file in question works fine when executed with the CGI or SAPI versions of PHP and worked fine with 4.2.3 cli but not with 4.3.1 The temporary work-around is to specify the absolute path to the include file (ewww!) or calculate the path (messy but portable). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23456&edit=1

« previous php.bugs (#38978) next »