php – Xdebug在访问类静态属性时中断
发布时间:2020-12-13 13:44:28 所属栏目:PHP教程 来源:网络整理
导读:我的开发环境中有Xdebug的问题. FROM library/php:5.5-apacheRUN apt-get -qqy update apt-get -qqy install libpq-dev libmcrypt-dev libxml2-dev ssl-cert vim git mc rm -r /var/lib/apt/lists/*# compile and add xdebugRUN pecl instal
我的开发环境中有Xdebug的问题.
FROM library/php:5.5-apache RUN apt-get -qqy update && apt-get -qqy install libpq-dev libmcrypt-dev libxml2-dev ssl-cert vim git mc && rm -r /var/lib/apt/lists/* # compile and add xdebug RUN pecl install xdebug && echo "zend_extension=xdebug.so" >> "/usr/local/etc/php/conf.d/xdebug.ini" # configure apache and vhosts RUN a2enmod rewrite ssl && a2ensite 000-default default-ssl ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 ENV APACHE_RUN_DIR /var/run/apache2 ENV APACHE_PID_FILE /var/run/apache2/apache2.pid ENV APACHE_LOCK_DIR /var/lock/apache2 CMD ["apache2-foreground"] Xdebug设置: [xdebug] xdebug.remote_enable=1 xdebug.remote_autostart=0 xdebug.remote_host=172.17.42.1 xdebug.remote_port=9000 一切都很好,但有一件事.调试代码时: <?php class A { static private $a; static public function init() { self::$a = 123; } } A::init(); 如果我在self :: $a = 123上设置一个断点;或者进入行,我得到: Fatal error: Access to undeclared static property: A::$a 如果我不进入该行,调试会话继续没有任何问题. 怎么了?
我认为这是XDebug中的一个bug – 请看这些bug报告
> http://bugs.xdebug.org/view.php?id=1185 同时,您可以通过使用xdebug_break()函数在抛出异常的行之前对其进行排序,并继续调试.抛出异常之后,我尝试在线上设置断点,我发现断点不足以阻止它抛出异常. 不是一个完美的解决方案,但希望很快就会修复这些错误 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |