dongxinyue2817 2013-10-31 17:15
浏览 101
已采纳

display_errors设置为On但在phpinfo()中显示Off

I'm on OS X 10.9 (though, it was the same in 10.8)

I'm trying to get display_errors set to On but can't figure it out. I didn't have a php.ini file in /etc so I copied /etc/php.ini.default cp /etc/php.ini.default /etc/php.ini.

I then went into /etc/php.ini and uncommented the line display_errors and set it to On - display_errors=On. Saved the file and went to phpinfo().

For "Configuration File (php.ini)" Path it shows "/etc" and for "Loaded Configuration File" it shows "/etc/php.ini" so I assume that means it's using the correct php.ini file right?

But, when I scroll down in phpinfo() it shows "display_errors" as Off for both Local Value and Master Value.

What am I doing wrong? Is there another place I need to turn display_errors On? I'm using PHP 5.4.17

Edit: Forgot to mention that I've restarted apache several times with sudo apachectl restart and still no change.

Also, I found it weird that before I copied php.ini.default to /etc/php.ini, php was presumably using some default php.ini file but display_errors was still set to Off. Isn't that On by default?

  • 写回答

1条回答 默认 最新

  • douwen3198 2013-10-31 17:27
    关注

    h2ooooooo got it figured out. I uncommented the wrong section to set it to On. It was turing back off later down the page. All good now.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?