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

From: Date: Fri, 02 May 2003 23:08:02 +0000
Subject: #23456 [Bgs->Opn]: CLI version path handling makes includes non-portable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38970@lists.php.net to get a copy of this message
ID: 23456 User updated by: don at lekei dot ca -Summary: CLI version does not access includes relative to script path Reported By: don at lekei dot ca -Status: Bogus +Status: Open -Bug Type: Unknown/Other Function +Bug Type: Feature/Change Request Operating System: ANY PHP Version: 4.3.1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#38970) next »