|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-09-09 18:08 UTC] php at ryank dot net
Description:
------------
When using the -d flag in php-cli on the include_path directive, only the first parameter is assigned to include_path.
C:\>php -v
PHP 5.2.6 (cli) (built: May 2 2008 18:02:07)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans
Reproduce code:
---------------
C:\>php -r "print ini_get('include_path');" -d include
_path=c:\test1.ini;c:\test2.ini
Expected result:
----------------
c:\test1.ini;c:\test2.ini
Actual result:
--------------
c:\test1.ini
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
This apparently works fine though... C:\>php -r "print ini_get('include_path');" -d include _path=.;c:\test1;c:\test2 .;c:\test1;c:\test2Double quotes do not appear to help: C:\>php -r "print ini_get('include_path');" -d include_path=".;:\test1;c:\test2" .;c:\test1;c:\test2 C:\>php -r "print ini_get('include_path');" -d include_path="c:\test1;c:\test2" c:\test1 Single quotes become part of the directive: C:\>php -r "print ini_get('include_path');" -d include_path='c:\test1;c:\test2' 'c:\test1Still having issues: C:\>php -r "print ini_get('include_path');" -d "include_path=c:\testing1;c:\testing2" c:\testing1 C:\>php -r "print ini_get('include_path');" -d "include_path=.;c:\testing1;c:\testing2" .;c:\testing1;c:\testing2Works fine for me: C:\php\src\Release_TS>php -v PHP 5.3.0alpha3-dev (cli) (built: Oct 2 2008 21:44:41) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies C:\php\src\Release_TS>php -r "print ini_get('include_path');" -d "include_path=' C:\test1.ini;C:\test2.ini'" C:\test1.ini;C:\test2.ini The Windows shell only likes the double quote sign, so therefore "include_path='xxxx'" will work. but not 'include_path="xxxx"' (Will cause a alert saying 'Invalid configuration directive')The bug is that 5.2 does not understand the use of apostrophes for quoting. This was fixed in 5.3. Test case #5 below shows a workaround for 5.2. The problem reported by ryank is not a bug because his quoting was wrong and so the semicolon was being interpreted as a statement separator. Ryank could not use the quoting solutions recommended by the others because the apostrophe didn't work for quoting in 5.2. Since ryank used PHP 5.2 and kalle used 5.3, they were seeing different results. To test this bug, I created a file named "test.php" and put the file in C:\ftp. Test case #1: This works in 5.2 and 5.3. php -r "print ini_get('include_path');require_once('test.php');" -d "include_path=C:\ftp" Test case #2: This fails in 5.2 and 5.3, but that's correct because the semicolon is a command separator: php -r "print ini_get('include_path');require_once('test.php');" -d "include_path=C:\tmp;C:\ftp" Test case #3: This fails in 5.2 and works in 5.3. This shows that 5.2 can't handle single quotes: php -r "print ini_get('include_path');require_once('test.php');" -d "include_path='C:\ftp'" Test case #4: This also fails in 5.2 and works in 5.3. However, the reason is because 5.2 can't handle the single quotes. php -r "print ini_get('include_path');require_once('test.php');" -d "include_path='C:\tmp;C:\ftp'" Test case #5: This works in both 5.2 and 5.3. It works around the 5.2 limitation. php -r "print ini_get('include_path');require_once('test.php');" -d "include_path=\"C:\tmp;C:\ftp\""