Why would auto_prepend_file works in .htaccess but

2019-08-25 08:41发布

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.

0条回答
登录 后发表回答