duanguoyin7008 2016-03-03 03:04
浏览 79
已采纳

PHP 7.0.2在出错时执行回溯

I'm running PHP version 7.0.2 on OS X El Capitan and every time I execute a PHP script that contains some erroneous code, it reports the error and then seems to perform a backtrace automatically. I'm not so sure if this is a new feature in PHP 7, however I cannot seem to find mention of it anywhere or anyone else who's facing a similar problem.

For Example:

<?php
   echo $a;
?>

Will return the following output if executed from CLI:

PHP Notice:  Undefined variable: a in /Path/to/file.php on line 2
PHP Stack trace:
PHP   1. {main}() /Path/to/file.php:0

Notice: Undefined variable: a in /Path/to/file.php on line 2

Call Stack:
    0.0002     350944   1. {main}() /Path/to/file.php:0

Any insight on what might be causing the problem is welcome. Thanks.

  • 写回答

2条回答 默认 最新

  • douba1067 2016-03-03 03:46
    关注

    The problem I was facing was not with PHP 7.0.2 itself, but with an extension that had somehow become enabled called XDebug. XDebug which is intended for advanced error reporting was causing problems in another project of mine and by disabling it, it seemed to solve my problem. In order to disable XDebug all you need to do is modify your php.ini file and change the values debug.remote_autostart, debug.default_enable, and debug.remote_enable from 'on' to 'off'.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services