Database Reference
In-Depth Information
name multiple directories, the separator character between directory pathnames is
colon (
:
) on Unix or semicolon (
;
) on Windows.
Specify the other environment variables (
RUBYLIB
,
PYTHONPATH
, and
CLASSPATH
) using
the same syntax.
Setting these environment variables as just discussed should suffice
for scripts that you run from the command line. For scripts intend‐
ed to be executed by a web server, you likely must configure the server
as well so that it can find the library files. See
Recipe 18.2
.
For PHP, the search path is defined by the value of the
include_path
variable in the
php.ini
PHP initialization file. On Unix, the file's pathname is likely
/usr/lib/php.ini
or
/
usr/local/lib/php.ini
. Under Windows, the file is likely found in the Windows directory
or under the main PHP installation directory. To determine the location, run this
commmand:
%
php --ini
Define the value of
include_path
in
php.ini
with a line like this:
include_path = "
value
"
Specify
value
using the same syntax as for environment variables that name directories.
That is, it's a list of directory names, with the names separated by colons on Unix or
semicolons on Windows. On Unix, if you want PHP to look for include files in the
current directory and in
/usr/local/lib/mcb
, set
include_path
like this:
include_path = ".:/usr/local/lib/mcb"
On Windows, to search the current directory and
C:\lib\mcb
, set
include_path
like
this:
include_path = ".;C:\lib\mcb"
If PHP is running as an Apache module, restart Apache to make
php.ini
changes take
effect.
Setting library-file access privileges
If you use a multiple-user system such as Unix, you must make decisions about library-
file ownership and access mode:
• If a library file is private and contains code to be used only by you, place the file
under your own account and make it accessible only to you. Assuming that a library
file named
mylib
is already owned by you, you can make it private like this:
%
chmod 600 mylib