Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
315 views
in Technique[技术] by (71.8m points)

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

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:wampwwwmyawesomeapp the global file (called config.php) is found at the root directory (I have some folders in there).

auto_prepend_file = "D:wampwwwmyawesomeappconfig.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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...