Page 1 of 1

Where to put global includes

Posted: Tue Feb 10, 2004 5:26 pm
by Burrito
I have created a new mail function file called mailer.php. I want to be able to call that function fom any page w/o including that file in the same folder. Where in PHP (for windoze) can I put the file so that it will include it by just using include("mailer.php").

thx for your time,

Burr

btw, my php installation is in c:\php

Posted: Tue Feb 10, 2004 5:31 pm
by DuFF
Just edit PHP.ini's include_path.

This is how mine looked at first:

Code: Select all

;Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
So you can just change it to:

Code: Select all

; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes;c:\path\to\folder"

Posted: Tue Feb 10, 2004 8:11 pm
by McGruff
Using the includes directory is a good option.

Another is to use an absolute path from the web root to the file.