Edit report at http://bugs.php.net/bug.php?id=46034&edit=1
ID: 46034 Comment by: jimb at connectedsw dot com Reported by: php at ryank dot net Summary: php cli -d include_path only accepts first parameter Status: Bogus Type: Bug Package: CGI related Operating System: WinXP PHP Version: 5.2.6 Block user comment: N Private report: N New Comment: 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\"" Previous Comments: ------------------------------------------------------------------------ [2008-10-24 15:43:58] j...@php.net There's no bug here. ------------------------------------------------------------------------ [2008-10-03 06:36:59] ka...@php.net Works 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') ------------------------------------------------------------------------ [2008-09-11 14:39:57] lbarn...@php.net The quotes are "used" by your shell, just like those around the php code. -d "include_path=foo;bar" is passed as -d include_path=foo;bar to php. You must enclose the quotes themselves, for example by using single quotes: -d 'include_path="foo;bar"' (works on "classic" shells, but I don't know how windows handles this) ------------------------------------------------------------------------ [2008-09-11 14:24:28] php at ryank dot net Still 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:\testing2 ------------------------------------------------------------------------ [2008-09-10 20:15:59] j...@php.net You need to enclose all of it in quotes: # php -d "include_path=some;path;here" .. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=46034 -- Edit this bug report at http://bugs.php.net/bug.php?id=46034&edit=1