問題描述
auto_prepend_file 多個文件 (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?
‑‑‑‑‑
參考解法
方法 1:
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';
(by Steve Robbins、Janis Elsts)