简体   繁体   English

MAMP pro PHP 错误处理悲伤

[英]MAMP pro PHP Error handling grief

So mamp pro is all set up using PHP 5.3.6 / cache is XCache, error handling set to Display Startup errors - write to All errors and warnings - to set to Display and Log both checked.所以mamp pro全部设置使用PHP 5.3.6/缓存为XCache,错误处理设置为Display Startup errors - write to All errors and warnings - 设置为Display and Log both checked。

restart the server, intentionally wrote some code that should bring up an error..重新启动服务器,故意写了一些应该引发错误的代码..

<?php
   echo stupid;
?>

Yes this is all thats in the code.是的,这就是代码中的全部内容。 I get nothing, No errors.我什么也没得到,没有错误。 only in the log, I don't want to have my console open the entire time watching for errors.仅在日志中,我不想让我的控制台一直打开以查看错误。 I want them printed on the screen.我希望它们打印在屏幕上。

The only way I can get this to work is by doing an INCLUDE on this code at the top of EVERY SINGLE PHP file.我能让它工作的唯一方法是在每个 PHP 文件的顶部对这段代码进行 INCLUDE。

error_reporting(E_ALL);
init-- yad yada ('display_errors', 'on');

From what I'm reading elsewhere, it seems like this is a big problem.. So how can I set up my mamp pro PHP.INI file to work properly and print directly to my browser?从我在其他地方读到的内容来看,这似乎是个大问题。那么如何设置我的 mamp pro PHP.INI 文件才能正常工作并直接打印到我的浏览器?

I changed it in MAMP/bin/php/php5.3.6/conf/php.ini我在 MAMP/bin/php/php5.3.6/conf/php.ini 中更改了它

You can change display_errors and display_startup_errors您可以更改 display_errors 和 display_startup_errors

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM