prepend a php script in all requests

Reinis Rozitis r at
Thu Sep 25 21:44:47 UTC 2014

> Once i have nginx installed with php fastcgi. Is it possible to preppend a 
> php script to be executed when serving any request? (similar to apache 
> prepend function). If yes could I please have an example. Thanks

PHP itself has such functionality .

If you want to change it from nginx you can add following line to your 
particular php/fastcgi block:

fastcgi_param  PHP_VALUE   "auto_prepend_file=/path/to/your/file.php";


More information about the nginx mailing list