php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51403 Multiple -d include_path command-line directives not handled correctly
Submitted: 2010-03-26 19:57 UTC Modified: 2010-03-26 21:49 UTC
From: ericp at activestate dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.2 OS: Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ericp at activestate dot com
New email:
PHP Version: OS:

 

 [2010-03-26 19:57 UTC] ericp at activestate dot com
Description:
------------
If I try to specify more than one include_path directive on
the command-line, only one sticks.  WIth the following two
command-lines, I expected to see two entries, but only saw
the first.

1. Default case -- I see all three entries from my php.ini
$ php test.php
include_path=.;C:\apps\xampp\php\PEAR;c:\apps\smarty\libs

$ php -d include_path=c:\php-5.2.8\PEAR;c:\php-5.2.8\PEAR\phpunit test.php
include_path=c:\php-5.2.8\PEAR

I was expecting to see both entries, not just the first.  I'd also
like an option to add to the existing include_path setting,
not just override it.


$ php -d include_path=c:\php-5.2.8\PEAR -d include_path=c:\php-5.2.8\PEAR\phpunit test.php
include_path=c:\php-5.2.8\PEAR\phpunit

Here I get the second entry only.

Test script:
---------------
<?php
print "include_path=";
print ini_get("include_path");
print "\n";
?>

Expected result:
----------------
See the description.

Actual result:
--------------
See the description.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-26 21:07 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2010-03-26 21:07 UTC] johannes@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

-d sets the setting, consequentially calls overwrite it, the last ones wins. That's the only consistent way to do it ...
 [2010-03-26 21:44 UTC] ericp at activestate dot com
But notice that this case fails to register both paths:

php -d include_path=c:\php-5.2.8\PEAR;c:\php-5.2.8\PEAR\phpunit test.php

- only the first path shows up.

It would be useful if the command-line version had a way to add
new directories to the include_path setting (after php.ini processing
has taken place).  I didn't see this in any existing bug.
 [2010-03-26 21:49 UTC] rasmus@php.net
That's because you didn't use quotes around your value there, so the shell ended 
your expression on the first semi-colon.  Not a PHP issue.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 12:01:33 2025 UTC