How to automatically include a file in PHP?

I would like to have a "site.php" file (similar to Python) that automatically turns on every time I call, for example. command line execution or HTTP request. This file contains several important replacement functions that should be available for both existing applications and new ones.

(Ie I need to include this file without modifying the files associated with the applications used.)

Is it possible? And if so, how?

+7
source share
2 answers

In php.ini set

auto_prepend_file="/path/to/site.php" 
+16
source

EDITED. Read the initial post too hastily, apologize.

In php.ini instead.

 auto_prepend_file="/path/to/site.php" 
+1
source

All Articles