douxian6260 2018-08-25 16:28
浏览 70

在Azure中使用PHP 7和自定义.ini文件时出错

I'm trying to make a custom .ini file to store sensitive information which I can then get using parse_ini_file. However I have some problems.

Using Azure I set up an Application Setting:

Name: PHP_INI_SCAN_DIR Value: D:\home\site\ini

It shows that its loading my custom ini file in phpinfo which I named test.ini Inside that I have...

[database_info]
;Database Information
dbUser=itstheuser
dbPassword=itsthepassword

[keys]
secretKey=aSeCreTKey

Then, in my php file I have

$ini = parse_ini_file('test.ini');
echo $ini['dbUser'];

However, this returned nothing, I tried an echo after this and that echoed fine, but the ini file did not. Note: this was using PHP 5.6.

I then updated to PHP 7.0 and I get the error...

The page cannot be displayed because an internal server error has occurred.

It seems PHP 7.0 does not like my custom ini file, because when I remove the ini file the error goes away and adding it back, brings back the error. I am unsure why this is.

So my problems are basically that I can't get my custom ini file to work, is there something I'm doing wrong?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 fluent的在模拟压强时使用希望得到一些建议
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样
    • ¥15 java的GUI的运用
    • ¥15 Web.config连不上数据库
    • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
    • ¥15 怎么配置广告联盟瀑布流
    • ¥15 Rstudio 保存代码闪退