|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63685 Make it easier to supply include paths on the CLI
Submitted: 2012-12-04 10:47 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: alastair at propcom dot co dot uk Assigned:
Status: Open Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: alastair at propcom dot co dot uk
New email:
PHP Version: OS:


 [2012-12-04 10:47 UTC] alastair at propcom dot co dot uk
C standard is to use -I to add an include path for header files. There are also the environment variables CPATH, C_INCLUDE_PATH and CPLUS_INCLUDE_PATH.

Other languages follow suit. Python uses the PYTHONPATH environment variable. Perl uses PERL5LIB *and* -I, and also has a runtime 'use lib' too.

PHP's current only way of doing it is to set the config itself (I didn't see anything about environment variables in the docs on include_path), which usually involves getting the config and manually merging the extras. 

Setting include paths is a much more common operation than the procedure to do so would suggest; it would be very helpful for this boilerplate code (get, merge, set) to be performed by PHP itself as a result of an option. -I is a good idea because it's established by C already, and hence maintains consistency. It would also be useful to honour an environment variable and possibly also a runtime function, just to make it easier.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-20 02:32 UTC] ben at hl9 dot net
While I agree somewhat with your sentiment

You can use php --define include_path=/path/to/your/stuff or shorter, -d include_path=/path/to...

You could also do this entirely in PHP, by reading the environment and using set_include_path().
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Mar 03 17:01:24 2021 UTC