Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

auto_prepend_file multiple files

Tags:

php

webserver

I'm trying to include multiple files server wide, so in etc/php.ini I have a few lines:

;Blowfish password
auto_prepend_file="/plugins/phpass-0.3/PasswordHash.php"

;WhoIs lookup
auto_prepend_file="/plugins/phpwhois-4.2.2/whois.main.php"

;IP database
;auto_prepend_file="/plugins/GeoIP/geoip.inc"
auto_prepend_file="/plugins/GeoIP/geoipcity.inc"

It would appear that only the last auto_prepend_file is being accepted, or it's overwriting the others.

How can I include multiple files?

like image 366
Steve Robbins Avatar asked Oct 25 '25 02:10

Steve Robbins


1 Answers

Create a separate loader file that require's the files you need, then prepend that file.

auto_prepend_file="/path/to/loader.php"

And in in loader.php:

require '/plugins/phpass-0.3/PasswordHash.php';
require '/plugins/phpwhois-4.2.2/whois.main.php';
require '/plugins/GeoIP/geoipcity.inc';
like image 169
Janis Elsts Avatar answered Oct 26 '25 16:10

Janis Elsts