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
494 views
in Technique[技术] by (71.8m points)

php - Why MAMP doesn't display errors?

OK this is getting very frustrating. MAMP used to display errors but then stopped. I decided to do a fresh install of it as I couldn't figure it out. I check my PHP version, running 5.4.4 and go to that folder and change the php.ini to this:

error_reporting  =  E_ALL
display_errors = On

Still no errors showing. I go through all the folders and change all php.ini files, just in case. Nothing. I fix the forced error and dump out phpinfo(), check the error section and display_errors is Off. What the hell.

I place error_reporting(E_ALL); ini_set('display_errors', 'on'); at the start of the PHP file and phpinfo() again. Local value is now On, master is still Off. Force a PHP error, and still get Server Error not PHP error.

Anybody have any insight? I have a bug somewhere in some code and cannot find it, would love for PHP to just tell me.

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

MAMP sets up a few different php.ini files for the server, the client etc. Check in your phpinfo() which php.ini actually is read. Looks like you're editing the wrong one.


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

...