Prepend a php script in all requests

Hey guys,

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

Alex

On Thu, Sep 25, 2014 at 12:05:30PM -0600, Alex Flex wrote:

Hi there,

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).

That sounds like it should be a feature of your fastcgi server or your
php runtime, rather than nginx.

I suggest searching for “fastcgi prepend” or “php prepend” in your
favourite search engine.

f

Francis D. [email protected]

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
PHP: Description of core php.ini directives - Manual .

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”;

rr