[UPHPU] setting path for command line PHP script

Richard K Miller richardkmiller at gmail.com
Tue Oct 28 15:14:25 MDT 2008


I use the following Apache directive to set the path for my web  
application's libraries. This allows me to set different paths on my  
production and dev machines:

<VirtualHost ...>
	...
	php_value include_path "/Users/richard/Sites/example.com/inc"
</VirtualHost>


What's the equivalent for the command line? Should I do something like  
this?

$ export php_include_path="/Users/richard/Sites/example.com/inc"

<?php
	ini_set('include_path', getenv('php_include_path'));
?>

Is there an environment variable PHP will automatically read for  
includes? I'd prefer not to have to explicitly set it myself.

This seems like it should be really obvious, but my searching hasn't  
brought up anything.

Richard




More information about the UPHPU mailing list