dongxing7083 2015-11-25 06:09
浏览 30
已采纳

PHP作曲家xdebug警告

New to PHP. Working on a PHP project and have xdebug enabled to be able to debug my php applications. The production server does not have xdebug enabled because it is handled by another team. On my local machine, when I run composer it gives me a warning saying

You are running composer with xdebug enabled. This has a major impact on 
runtime performance.

I do not want to disable xdebug when I am developing. Just wanted to confirm that running xdebug in dev environment should have no impact on the composer installing libraries/performance of the app on the production server.

  • 写回答

6条回答 默认 最新

  • dscqrkvr9562034621 2015-11-25 23:12
    关注

    I do not want to disable xdebug when I am developing. Just wanted to confirm that running xdebug in dev environment should have no impact on the composer installing libraries/performance of the app on the production server.

    There is a huge impact of just loading Xdebug. It slows the Composer run down by 3x or 4x, even when the profiling feature is not enabled.

    In other words: xdebug is invaluable for debugging, but increases the memory used and processing time of Composer.


    How to disable Xdebug for Composer runs?

    My suggestion is to write a little invocation helper for running Composer.

    The helper is a bash or batch script calling PHP with a custom php.ini, especially configured for Composer. Lets call it: php.ini-composer.

    You could copy your current php.ini and adjust it for the Composer run, by removing xdebug or commenting it out, like so: ;zend_extension = "/path/to/my/xdebug.so".

    While you are at it: setting memory_limit=-1 is helpful, too.

    The full command looks like so on Windows: php.exe -c php.ini-composer composer.phar %*

    Just clone the idea for a bash script.


    And you may find the full answer to your question in the Composer FAQ.

    https://getcomposer.org/doc/articles/troubleshooting.md#xdebug-impact-on-composer

    It was added/updated just a few hours ago.


    Some alternatives (instead of using seperate ini file) are also mentioned here.

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

报告相同问题?

悬赏问题

  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥15 在现有系统基础上增加功能