Why would auto_prepend_file works in .htaccess but not in php.ini?

血红的双手。 提交于 2019-12-25 02:38:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!