问题
So I'm using PHP's auto_prepend_file
to load a config file I use. I tried doing it from php.ini but the file was never loaded. After some ... hours, I used .htaccess and voila, it works!
I'm using my own machine on windows 7 with wamp installed. The app is found under D:\wamp\www\myawesomeapp
the global file (called config.php) is found at the root directory (I have some folders in there).
auto_prepend_file = "D:\wamp\www\myawesomeapp\config.php"
did not work, however, adding php_value auto_prepend_file D:/wamp/www/myawesomeapp/config.php
works perfectly fine.
Why? Shouldn't the config from php.ini just works? I also investigated include_path and added the app's folder just in case but still did not work.
来源:https://stackoverflow.com/questions/22171850/why-would-auto-prepend-file-works-in-htaccess-but-not-in-php-ini