php.net |  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: 2021-03-16 11:13 UTC
Votes:1
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: cmb (profile)
Status: Closed Package: PHP options/info functions
PHP Version: Irrelevant OS:
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: 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
Description:
------------
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.




Patches

Pull Requests

History

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().
 [2021-03-16 11:13 UTC] cmb@php.net
-Status: Open +Status: Closed -Package: *General Issues +Package: PHP options/info functions -Assigned To: +Assigned To: cmb
 [2021-03-16 11:13 UTC] cmb@php.net
You can also use environment variables in the INI files[1].

[1] <https://www.php.net/manual/en/configuration.file.php>
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 02:01:36 2025 UTC