faqts : Computers : Programming : Languages : PHP : Installation and Setup : General

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

15 of 19 people (79%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Can I set an auto prepend file without changing php3.ini?
Can PHP be configured to run a certain script before every page request?
What is auto_prepend_file used for?

Jul 2nd, 1999 18:52
Nathan Wallace,


PHP can be configured to run a script (the prepend file) before every
page script is executed.

This file, the auto prepend file can be setup in your php3.ini file.

If you don't have permission to change your php3.ini file then in the
directory that contains the scripts which you want prepended you have to
create/edit the .htaccess file.  This file is used by Apache for
configuration on a per directory basis.

Add the following line to your .htaccess

php3_auto_prepend_file /path/to/my_prepend_file.inc

Remember that the .htaccess file cascades down to the subdirectories of
where it is located so the settings will be used there as well.

http://www.php.net/manual/configuration.php3