Steve Robbins
Steve Robbins

Reputation: 13812

auto_prepend_file multiple files

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?

Upvotes: 3

Views: 3648

Answers (1)

Janis Elsts
Janis Elsts

Reputation: 764

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

Upvotes: 4

Related Questions