Yet Another Swoole Debugger

Last update: May 25, 2022

English | 中文

yasd

Yet Another Swoole Debugger. document

How to use it

build

You'll need to install the Boost library first.

macOS:

brew install boost

Ubuntu:

apt-get install libboost-all-dev

CentOS:

yum install boost boost-devel
phpize --clean && \
phpize && \
./configure && \
make clean && \
make && \
make install

set the ini file:

zend_extension=yasd

see the extension info:

php --ri yasd

IDE debug mode

zend_extension=yasd
yasd.debug_mode=remote
yasd.remote_host=127.0.0.1
yasd.remote_port=9000

cmd debug mode

All command supports fuzzy matching of priorities.

set the ini file:

zend_extension=yasd
yasd.debug_mode=cmd

start debug

php -e test.php

list

l

list source code

breakpoint

b absolute-file-path lineno

This will also save the breakpoint information in the cache file -- .breakpoints_file.log

You can change this file name by the ini file, e.g.

yasd.breakpoints_file="yasd.log"

If the cache file exists, the breakpoints in the file are automatically loaded when debug is started.

Delete breakpoints

d number

If a breakpoint is set or deleted without specifying absolute-file-path, It will set breakpoint in the current file.

watch point

We can monitor the variable changes or expression, for example:

watch $a
watch $a > 10
watch $name == 'swoole'

unwatch point

unwatch number

run

r

step over

n

step into

s

step out

f

backtrace

bt

info

show all breakpoints:

info breakpoints

show all watchpoints:

info watchpoints

continue

c

quit

q

print

p $a
p $this
p $this->prop

level

le

Q&A

Debugging with phpstorm (remote mode)

  • the port phpstorm listens on should be the one used for xdebug, also make sure remote connections are allowed: image

  • do NOT forget to use -e option when running scripts, debugging will not work otherwise

  • ensure that phpstorm listens on incoming connections:

image

Slow Start Framework

When using yasd, if the framework starts slowly (most of the time it's because the framework is scanning a lot of files), you can execute the following command.

Hyperf
composer dump-autoload -o

Then modify the following configuration config/config.php:

'scan_cacheable' => env('SCAN_CACHEABLE', true)
Imi

We did not find a slow start problem.

EasySwoole

We did not find a slow start problem.

MixPHP

We did not find a slow start problem.

Swoft

We did not find a slow start problem.

One

We did not find a slow start problem.

The breakpoint is not triggered

  1. No absolute path to the file is used
  2. The breakpoint is not a valid line, such as a function declaration, blank line, etc
  3. The code is generated with proxy classes, such as Hyperf. So you need to set breakpoints in the proxy class.

GitHub

https://github.com/swoole/yasd
Comments
  • 1. Unable to connect using VSCode

    The installation is done

    I'm using laravel-s on a containerized environment.

    image

    zend_extension=yasd yasd.debug_mode=remote yasd.remote_host=127.0.0.1 yasd.remote_port=9000

    but not connecting on VsCode

    image

    Originally posted by @juberjj in https://github.com/swoole/yasd/issues/78#issuecomment-760904975

    Reviewed by juber-ivre at 2021-01-15 23:27
  • 2. Why it says that is supports phpstorm ide, when tests cases for phpstorm compatability fail

    Please answer these questions before submitting your issue. Thanks!

    1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

    make test

    1. What did you expect to see?

    All passed

    1. What did you see instead?
    Don't forget to run 'make test'.
    
    
    =====================================================================
    PHP         : /usr/local/Cellar/php/8.0.2/bin/php
    PHP_SAPI    : cli
    PHP_VERSION : 8.0.2
    ZEND_VERSION: 4.0.2
    PHP_OS      : Darwin - Darwin Linass-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
    INI actual  : /Users/juslintek/yasd/tmp-php.ini
    More .INIs  :
    ---------------------------------------------------------------------
    PHP         : /usr/local/Cellar/php/8.0.2/bin/phpdbg
    PHP_SAPI    : phpdbg
    PHP_VERSION : 8.0.2
    ZEND_VERSION: 4.0.2
    PHP_OS      : Darwin - Darwin Linass-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
    INI actual  : /Users/juslintek/yasd/tmp-php.ini
    More .INIs  :
    ---------------------------------------------------------------------
    CWD         : /Users/juslintek/yasd
    Extra dirs  :
    VALGRIND    : Not used
    =====================================================================
    TIME START 2021-02-22 09:43:21
    =====================================================================
    FAIL issue: 41 [tests/yasd_debugger/issue/41.phpt]
    PASS opcode: getOpcodeByName [tests/yasd_debugger/opcode/getOpcodeByName.phpt]
    FAIL remote_mode: breakpoint_list [tests/yasd_debugger/remote_mode/breakpoint_list.phpt]
    FAIL remote_mode: breakpoint_set [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set.phpt]
    TEST 5/20 [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set_conditiFAIL breakpoint_set: breakpoint_set_conditional_line [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set_conditional_line.phpt]
    FAIL remote_mode: context_get [tests/yasd_debugger/remote_mode/context_get.phpt]
    TEST 7/20 [tests/yasd_debugger/remote_mode/context_get/superglobal_variable.phptFAIL context_get: superglobal_variable [tests/yasd_debugger/remote_mode/context_get/superglobal_variable.phpt]
    FAIL remote_mode: context_names [tests/yasd_debugger/remote_mode/context_names.phpt]
    FAIL remote_mode: eval [tests/yasd_debugger/remote_mode/eval.phpt]
    FAIL remote_mode: feature_set [tests/yasd_debugger/remote_mode/feature_set.phpt]
    TEST 11/20 [tests/yasd_debugger/remote_mode/infinite_loop_detection/for_loop.phpFAIL infinite_loop_detection: for_loop [tests/yasd_debugger/remote_mode/infinite_loop_detection/for_loop.phpt]
    TEST 12/20 [tests/yasd_debugger/remote_mode/infinite_loop_detection/goto_label_lFAIL infinite_loop_detection: goto_label_loop [tests/yasd_debugger/remote_mode/infinite_loop_detection/goto_label_loop.phpt]
    TEST 13/20 [tests/yasd_debugger/remote_mode/phpstorm/compatible_with_phpstorm.phFAIL phpstorm: compatible_with_phpstorm [tests/yasd_debugger/remote_mode/phpstorm/compatible_with_phpstorm.phpt]
    FAIL phpstorm: eval [tests/yasd_debugger/remote_mode/phpstorm/eval.phpt]
    TEST 15/20 [tests/yasd_debugger/remote_mode/property_get/classnamme_array_key.phFAIL property_get: classnamme_array_key [tests/yasd_debugger/remote_mode/property_get/classnamme_array_key.phpt]
    TEST 16/20 [tests/yasd_debugger/remote_mode/property_get/nmerical_index_array.phFAIL property_get: nmerical_index_array [tests/yasd_debugger/remote_mode/property_get/nmerical_index_array.phpt]
    FAIL remote_mode: stack_get [tests/yasd_debugger/remote_mode/stack_get.phpt]
    FAIL remote_mode: stdout [tests/yasd_debugger/remote_mode/stdout.phpt]
    FAIL remote_mode: stop [tests/yasd_debugger/remote_mode/stop.phpt]
    PASS zval: getRefCount [tests/yasd_debugger/zval/getRefCount.phpt]
    =====================================================================
    TIME END 2021-02-22 09:43:22
    
    =====================================================================
    TEST RESULT SUMMARY
    ---------------------------------------------------------------------
    Exts skipped    :    0
    Exts tested     :   64
    ---------------------------------------------------------------------
    
    Number of tests :   20                20
    Tests skipped   :    0 (  0.0%) --------
    Tests warned    :    0 (  0.0%) (  0.0%)
    Tests failed    :   18 ( 90.0%) ( 90.0%)
    Tests passed    :    2 ( 10.0%) ( 10.0%)
    ---------------------------------------------------------------------
    Time taken      :    1 seconds
    =====================================================================
    
    =====================================================================
    FAILED TEST SUMMARY
    ---------------------------------------------------------------------
    issue: 41 [tests/yasd_debugger/issue/41.phpt]
    remote_mode: breakpoint_list [tests/yasd_debugger/remote_mode/breakpoint_list.phpt]
    remote_mode: breakpoint_set [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set.phpt]
    breakpoint_set: breakpoint_set_conditional_line [tests/yasd_debugger/remote_mode/breakpoint_set/breakpoint_set_conditional_line.phpt]
    remote_mode: context_get [tests/yasd_debugger/remote_mode/context_get.phpt]
    context_get: superglobal_variable [tests/yasd_debugger/remote_mode/context_get/superglobal_variable.phpt]
    remote_mode: context_names [tests/yasd_debugger/remote_mode/context_names.phpt]
    remote_mode: eval [tests/yasd_debugger/remote_mode/eval.phpt]
    remote_mode: feature_set [tests/yasd_debugger/remote_mode/feature_set.phpt]
    infinite_loop_detection: for_loop [tests/yasd_debugger/remote_mode/infinite_loop_detection/for_loop.phpt]
    infinite_loop_detection: goto_label_loop [tests/yasd_debugger/remote_mode/infinite_loop_detection/goto_label_loop.phpt]
    phpstorm: compatible_with_phpstorm [tests/yasd_debugger/remote_mode/phpstorm/compatible_with_phpstorm.phpt]
    phpstorm: eval [tests/yasd_debugger/remote_mode/phpstorm/eval.phpt]
    property_get: classnamme_array_key [tests/yasd_debugger/remote_mode/property_get/classnamme_array_key.phpt]
    property_get: nmerical_index_array [tests/yasd_debugger/remote_mode/property_get/nmerical_index_array.phpt]
    remote_mode: stack_get [tests/yasd_debugger/remote_mode/stack_get.phpt]
    remote_mode: stdout [tests/yasd_debugger/remote_mode/stdout.phpt]
    remote_mode: stop [tests/yasd_debugger/remote_mode/stop.phpt]
    =====================================================================
    
    You may have found a problem in PHP.
    This report can be automatically sent to the PHP QA team at
    http://qa.php.net/reports and http://news.php.net/php.qa.reports
    This gives us a better understanding of PHP's behavior.
    If you don't want to send the report immediately you can choose
    option "s" to save it.	You can then email it to [email protected] later.
    Do you want to send this report now? [Yns]: Y
    
    Please enter your email address.
    (Your address will be mangled so that it will not go out on any
    mailinglist in plain text): [email protected]
    
    Posting to http://qa.php.net/buildtest-process.php
    
    Thank you for helping to make PHP better.
    make: *** [test] Error 1
    
    1. What is your machine environment used (show your uname -a & php -v & gcc -v) ? uname -a
    Darwin Linass-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
    

    php -v

    PHP 8.0.2 (cli) (built: Feb  4 2021 18:57:55) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v4.0.2, Copyright (c) Zend Technologies
        with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies
    

    gcc - v

    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    Apple clang version 12.0.0 (clang-1200.0.32.29)
    Target: x86_64-apple-darwin20.3.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    
    Reviewed by juslintek at 2021-02-22 09:50
  • 3. master分支vscode + remote模式直接segmentation fault

    ➜  ~ php7.4 -v         
    PHP 7.4.13 (cli) (built: Nov 28 2020 06:24:43) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Yasd v0.2.6, Our Copyright, by codinghuang
        with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
    
    ➜  ~ php7.4 --ri yasd
    
    yasd
    
    Yasd => enabled
    Author => codinghuang <[email protected]>
    Version => 0.2.6
    Built => Dec 22 2020 18:07:46
    
    Directive => Local Value => Master Value
    yasd.breakpoints_file => no value => no value
    yasd.debug_mode => remote => remote
    yasd.remote_host => 127.0.0.1 => 127.0.0.1
    yasd.remote_port => 9000 => 9000
    yasd.depth => 1 => 1
    
    ➜  yasd git:(master) php7.4 -e test.php
    [1]    6544 segmentation fault (core dumped)  php7.4 -e test.php
    ➜  yasd git:(master) ✗ gdb php7.4 -c core
    GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from php7.4...(no debugging symbols found)...done.
    [New LWP 6544]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Core was generated by `php7.4 -e test.php'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  0x00007fcd9a73e34c in yasd::Util::is_hit_watch_point () at /home/jobin/software/yasd/src/util.cc:278
    278         zend_function *func = EG(current_execute_data)->func;
    (gdb) bt
    #0  0x00007fcd9a73e34c in yasd::Util::is_hit_watch_point () at /home/jobin/software/yasd/src/util.cc:278
    #1  0x00007fcd9a73c0c3 in yasd_statement_call (frame=<optimized out>) at /home/jobin/software/yasd/yasd.cc:173
    #2  0x0000556c79a710a2 in zend_llist_apply_with_argument ()
    #3  0x0000556c798d622b in ?? ()
    #4  0x0000556c79b03fac in execute_ex ()
    #5  0x00007fcd9a73ebbf in yasd_execute_ex (execute_data=0x7fcd9ae13020) at /home/jobin/software/yasd/src/base.cc:96
    #6  0x0000556c79b0a4a2 in zend_execute ()
    #7  0x0000556c79a7d532 in zend_execute_scripts ()
    #8  0x0000556c79a1c070 in php_execute_script ()
    #9  0x0000556c79b0c4a3 in ?? ()
    #10 0x0000556c798d79e6 in ?? ()
    #11 0x00007fcd9daa7b97 in __libc_start_main (main=0x556c798d75d0, argc=3, argv=0x7fffb580d7b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
        stack_end=0x7fffb580d7a8) at ../csu/libc-start.c:310
    #12 0x0000556c798d7b8a in _start ()
    (gdb) 
    

    image

    机器的两个 php 版本 php7.2php7.4 都是这个情况。调试的是项目提供的test.php

    Reviewed by jobinli at 2020-12-23 01:44
  • 4. win10 wsl 环境 支持?

    [email protected]:/usr/local/php/etc# php --ri yasd
    
    yasd
    
    Yasd => enabled
    Author => codinghuang <[email protected]>
    Version => 0.2.7-alpha
    Built => Dec 23 2020 18:11:44
    
    Directive => Local Value => Master Value
    yasd.breakpoints_file => no value => no value
    yasd.debug_mode => remote => remote
    yasd.remote_host => 127.0.0.1 => 127.0.0.1
    yasd.remote_port => 8000 => 8000
    yasd.depth => 1 => 1
    yasd.log_level => -1 => -1
    
    
    [email protected]:/usr/local/php/etc# php -v
    PHP 7.2.19 (cli) (built: Jun 23 2019 10:08:57) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Yasd v0.2.7-alpha, Our Copyright, by codinghuang
    
    

    版本:wsl1

    适用于 Linux 的 Windows 子系统:
    Ubuntu-18.04 (默认)
    

    启动 php -e t.php PHPSTORM 报错:无法接受外部 Xdebug 连接: 无法评估表达式 'isset($_SERVER['PHP_IDE_CONFIG'])'

    Reviewed by tw2066 at 2020-12-24 05:16
  • 5. mac php7.2.33 php -e bin/hyperf.php start 报错 86691 segmentation fault

    ➜ ~ php -v PHP 7.2.33 (cli) (built: Aug 7 2020 18:28:03) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.33, Copyright (c) 1999-2018, by Zend Technologies with Yasd v0.1.0, Our Copyright, by codinghuang

    ➜ ~ php --ri yasd

    yasd

    Yasd => enabled Author => codinghuang [email protected] Version => 0.1.0 Built => Dec 17 2020 17:35:30

    Directive => Local Value => Master Value yasd.breakpoints_file => no value => no value yasd.debug_mode => remote => remote yasd.remote_host => 127.0.0.1 => 127.0.0.1 yasd.remote_port => 9000 => 9000 yasd.depth => 1 => 1

    执行 ✗ php -e bin/hyperf.php start [1] 86691 segmentation fault php -e bin/hyperf.php start

    Reviewed by ice-leng at 2020-12-17 11:02
  • 6. yasd如何使用

    [xdebug] zend_extension=xdebug.so xdebug.remote_enable=1 xdebug.remote_autostart=1 xdebug.remote_host=192.168.1.134 xdebug.remote_port=9000 xdebug.idekey="xdebug"

    类似这样设置idekey

    Reviewed by coding-linheng at 2020-12-30 11:21
  • 7. Swoole http server stops on restart of Docker when yasd is turned on

    Please answer these questions before submitting your issue. Thanks!

    1. What did you do? If possible, provides a simple script and debug step to reproduce the problem. I use VS code and Swoole Docker - php8 dev and running Mezzio on Linux Everything was working really fine, even with supervisor and inotify but recently i noticed when i turn on yasd and i restart the container so the yasd can work, i see this logs

    When i stop yasd i see this message [yasd] recv command error, connection closed

    but when i stop yasd, Swoole works fine

    1. What did you expect to see? SWoole http server working with yasd and stopping at break points

    2. What did you see instead? logs

    3. What is your machine environment used (show your uname -a & php -v & gcc -v) ? On Docker: uname -a: Linux f271c7329e8c 5.8.18-100.fc31.x86_64 #1 SMP Mon Nov 2 20:32:55 UTC 2020 x86_64 GNU/Linux

    php -v PHP 8.0.3 (cli) (built: Apr 10 2021 13:10:41) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.3, Copyright (c) Zend Technologies with Yasd v0.3.7, Our Copyright, by codinghuang

    gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 8.3.0 (Debian 8.3.0-6)

    yasd is built like this in docker file

    Reviewed by babarinde at 2021-05-12 23:28
  • 8. phpstorm使用yasd自动停留在

    Please answer these questions before submitting your issue. Thanks!

    1. What did you do? If possible, provides a simple script and debug step to reproduce the problem. 开启断点调试 , 为什么会在这个 ProxyManager 处等待调试呢 ? (我并没有在此处设置断点 ) ,
      配置 : SCAN_CACHEABLE = false , 断点会一直在附近打转 . 把配置改为true , 只会走3~4次 就走完了.

    2. What did you expect to see? 这是什么原因呢 ? 本身如此 ? 还是扩展bug ? 麻烦大佬解答一下

    3. What did you see instead? image

    4. What is your machine environment used (show your uname -a & php -v & gcc -v) ? WIN10 , WSL2 , hyperf项目在Docker容器里跑 . phpstorm 2021.1 1)Linux a95ca3b42538 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 Linux 2)PHP 7.4.19 (cli) (built: May 23 2021 06:27:45) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies with Yasd v0.3.6, Our Copyright, by codinghuang 3)/bin/sh: gcc: not found

    Reviewed by cuixiong at 2021-05-28 17:27
  • 9. A bug occurred in Swoole-v4.5.9

    Please answer these questions before submitting your issue. Thanks!

    1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

    [2020-12-09 22:20:37 $61715.0] WARNING wait: worker#0 abnormal exit, status=0, signal=11 A bug occurred in Swoole-v4.5.9, please report it. The Swoole developers probably don't know about it, and unless you report it, chances are it won't be fixed. You can read How to report a bug doc before submitting any bug reports:

    https://github.com/swoole/swoole-src/blob/master/.github/ISSUE.md Please do not send bug reports in the mailing list or personal letters. The issue page is also suitable to submit feature requests.

    image image

    Reviewed by zsboss at 2020-12-09 14:24
  • 10. Unable to build

    Please answer these questions before submitting your issue. Thanks!

    1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.

    Cloned the repo.

    1. What did you expect to see?

    Makefile to build solution

    1. What did you see instead? N/A

    2. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

    I'm unable to follow steps for installation after clone the repo. There's no Makefile.

    Any suggestions?

    5.4.0-60-generic #67-Ubuntu SMP Tue Jan 5 18:31:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

    php -v PHP 7.3.25 (cli) (built: Dec 17 2020 09:49:54) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.25, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.25, Copyright (c) 1999-2018, by Zend Technologies with Sdebug v2.9.3-dev, Copyright (c) 2002-2020, by Derick Rethans

    Reviewed by juber-ivre at 2021-01-15 00:04
  • 11. 在phpstorm下关闭调试模式服务器直接502了

    相关版本: --macos 10.14.6 --phpstorm 2019.3.4 --PHP 7.3.18 --- yasd ` Yasd => enabled Author => codinghuang [email protected] Version => 0.3.2-alpha Built => Jan 4 2021 18:52:55

    Directive => Local Value => Master Value yasd.breakpoints_file => no value => no value yasd.debug_mode => remote => remote yasd.remote_host => 127.0.0.1 => 127.0.0.1 yasd.remote_port => 9900 => 9900 yasd.depth => 1 => 1 yasd.log_level => -1 => -1 xdebug.coverage_enable => 1 => 1 xdebug.profiler_enable => 1 => 1 xdebug.remote_autostart => 1 => 1 xdebug.remote_connect_back => 0 => 0 xdebug.remote_mode => req => req `

    开启phpstorm调试模式时,可以正常访问 localhost 但关闭phpstorm调试模式后,再访问就会报下面的错误 ` 2021/01/04 20:00:00 [error] 215#0: *2291 kevent() reported about an closed connection (54: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"

    `

    Reviewed by coding-lover at 2021-01-04 12:07
  • 12. View private properties of parent class will crashed

    1. What did you do? If possible, provides a simple script and debug step to reproduce the problem.
    // In PHPStorm
    <?php
    
    class Foo
    {
      public $name = 'foo';
    }
    
    class Bar
    {
      private $foo;
    
      public function __construct()
      {
        $this->foo = new Foo();
      }
    }
    
    class AnotherBar extends Bar
    {
      public function hello()
      {
        echo 'hello'; // 在这打断点,查看$this->foo时直接退出
      }
    }
    
    $bar = new AnotherBar();
    $bar->hello();
    
    1. What did you expect to see?

    能正常查看对应的值

    1. What did you see instead?

    报错退出 image

    1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
    Darwin anhoder-4.local 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:47:26 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T8101 arm64
    
    PHP 8.0.15 (cli) (built: Jan 20 2022 04:21:28) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v4.0.15, Copyright (c) Zend Technologies
        with Yasd v0.3.9-alpha, Our Copyright, by codinghuang
        with Zend OPcache v8.0.15, Copyright (c), by Zend Technologies
    
    Apple clang version 13.1.6 (clang-1316.0.21.2.3)
    Target: arm64-apple-darwin21.4.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    
    Reviewed by anhoder at 2022-04-15 01:25
  • 13. using Yasd widh curl or requests form browser / PHPStorm

    Hey, I am using a dockerized environment with:

    1. laravel octan (swoole)
    2. nginx to octan
    3. traefik for reverse proxy (so I dont't have to use different Ports on each project)

    I am able to use Yasd with the following settings:

    [yasd]
    yasd.debug_mode=remote
    yasd.remote_host=172.17.0.1
    yasd.remote_port=9000
    

    If I run php -e test.ph in the container PHPStorm is hitting the break points.

    As written in https://github.com/swoole/docker-swoole/tree/master/examples/35-debug-with-yasd I should be able to debug curl requests and browser requests from outside the container.

    I started the entire server with the e-flag:

    php -e artisan octane:start --server="swoole" --host="0.0.0.0" --workers=auto --task-workers=auto --max-requests=500
    

    Is there anything else I need to do, to debug requests?

    edit: Even after accessing the container directly (without trafik / nginx) it is not possible to call the debugger via curl:

    swoole-dev:
        build:
            context: ./devOps/api/docker/dev/swoole/
            dockerfile: Dockerfile
        environment:
            PHP_IDE_CONFIG: "serverName=myServer"
            SHELL: /bin/sh
        ports:
            - "80:80"
        volumes:
            - ./app/api:/app
            - ./devOps/api/docker/dev/swoole/conf/custom.ini:/usr/local/etc/php/conf.d/custom.ini
        env_file:
            - ./devOps/api/docker/dev/etc/environment.env
        logging:
            driver: "json-file"
            options:
                max-size: "5m"
    
    Reviewed by Cluster2a at 2022-04-14 11:04
  • 14. Yasd don't reload breakpoints with Swoole hot reloading

    Swoole supports hot code reloading by using the linux command

    kill -USR1 MASTER_PID
    

    (MASTER_PID in my case is 1 ) Yasd don't reload breakpoints after worker restarted.

    Steps to reproduce

    1. Run swoole server
    2. Add new breakpoint to any line of code
    3. Run command kill -USR1 MASTER_PID
    4. Workers restarted successfully
    5. Trigger the code with request

    As the result Yasd don't stop on new breakpoint.

    Reviewed by dmitryuk at 2022-03-15 04:01
  • 15. MacbookPro16(Intel) macOs Monterey 安装php7.4.26后报错

    bash-5.0# php -v PHP Warning: Failed loading Zend extension 'yasd' (tried: /usr/lib/php7/modules/yasd (Error loading shared library /usr/lib/php7/modules/yasd: No such file or directory), /usr/lib/php7/modules/yasd.so (Error loading shared library libboost_filesystem.so.1.72.0: No such file or directory (needed by /usr/lib/php7/modules/yasd.so))) in Unknown on line 0 PHP 7.4.26 (cli) (built: Jan 18 2022 21:29:34) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies

    php 版本:php7.4.26 swoole 版本:4.8.7 系统:macOs Monterey

    Reviewed by lujihong at 2022-02-22 09:30
  • 16. Fix building warnings

    While building yasd where are a lot of warnings:

    /tmp/yasd/yasd.cc:226:9: warning: variable 'start_lineno' set but not used [-Wunused-but-set-variable]
      226 |     int start_lineno;
          |     ^~~~~~~~~~~~~~~~~~~~~~~
    /tmp/yasd/yasd.cc:340:5: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
      340 |     "Yasd",
          |     ^~~~~~
    In file included from /tmp/yasd/yasd.cc:33:
    /tmp/yasd/./php_yasd.h:29:26: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
       29 | #define PHP_YASD_VERSION "0.3.9-alpha"
          |                          ^~~~~~~~~~~~~
    /tmp/yasd/yasd.cc:341:5: note: in expansion of macro 'PHP_YASD_VERSION'
      341 |     PHP_YASD_VERSION,
          |     ^~~~~~~~~~~~~~~~
    /tmp/yasd/yasd.cc:342:5: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
      342 |     "codinghuang",
          |     ^~~~~~~~~~~~~
    /tmp/yasd/yasd.cc:343:5: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
      343 |     "https://github.com/huanghantao",
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /tmp/yasd/yasd.cc:344:5: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
      344 |     "Our Copyright",
          |     ^~~~~~~~~~~~~~~
    
    

    The PR fixes them

    Reviewed by dmitryuk at 2022-02-22 05:17
  • 17. Hyper2.2框架

    [yasd] recv command error, connection closed [yasd] recv command error, Connection reset by peer [2022-01-11 10:10:16 $81296.0] WARNING Server::check_worker_exit_status(): worker(pid=81314, id=9) abnormal exit, status=0, signal=11 A bug occurred in Swoole-v4.8.5, please report it. The Swoole developers probably don't know about it, and unless you report it, chances are it won't be fixed. You can read How to report a bug doc before submitting any bug reports:

    https://github.com/swoole/swoole-src/blob/master/.github/ISSUE.md Please do not send bug reports in the mailing list or personal letters. The issue page is also suitable to submit feature requests.

    OS: Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64 GCC_VERSION: Apple LLVM 13.0.0 (clang-1300.0.29.3) PHP_VERSION : 7.4.25

    [INFO] Worker#9 started.

    Reviewed by laohekou at 2022-01-11 02:12
The Interactive PHP Debugger

The interactive PHP debugger Implemented as a SAPI module, phpdbg can exert complete control over the environment without impacting the functionality

Apr 26, 2022
Dontbug is a reverse debugger for PHP
Dontbug is a reverse debugger for PHP

Dontbug Debugger Dontbug is a reverse debugger (aka time travel debugger) for PHP. It allows you to record the execution of PHP scripts (in command li

May 8, 2022
Php Debugger to run in terminal to debug your code easily.
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source lib to make a debug in php direct in terminal, without necessary configure an IDE. Th

Jan 12, 2022
A Laravel Package to integrate Nette Tracy Debugger
A Laravel Package to integrate Nette Tracy Debugger

Nette Tracy for Laravel 5 Better Laravel Exception Handler Features Visualization of errors and exceptions Debugger Bar (ajax support @v1.5.6) Excepti

May 3, 2022
Php Debugger to run in terminal to debug your code easily.
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source library that allows a developer to debug in php direct in terminal, without necessary

May 20, 2022
Slim Framework Tracy Debugger Bar
 Slim Framework Tracy Debugger Bar

Slim Framework Tracy Debugger Bar configure it by mouse now in package: Panel Description Slim Framework - Slim Environment RAW data Slim Container RA

Feb 26, 2022
Yet Another LINQ to Objects for PHP [Simplified BSD]

YaLinqo: Yet Another LINQ to Objects for PHP Online documentation GitHub repository Features The most complete port of .NET LINQ to PHP, with many add

May 9, 2022
YAPS - Yet Another PHP Shell
 YAPS - Yet Another PHP Shell

YAPS - Yet Another PHP Shell Yeah, I know, I know... But that's it. =) As the name reveals, this is yet another PHP reverse shell, one more among hund

May 12, 2022
Yet another Value Object Library (YAVOL)

Yet Another DDD Library Value object This library is a foundation in order to implement the Value Object pattern. It helps you to introduce some DDD s

Jan 4, 2022
Simple and minimal yet another PHP 7 Framework

DemirApp Minimal PHP Framework Introduction Simple and minimal yet another PHP 7 Framework Features Simple routing Simple container (Dependency Inject

Feb 12, 2022
Yet another PHP Microframework.

ρ Yet another PHP Microframework. The premise of this framework is to be backwards-compatible (PHP <= 5.6) with powerful utilities (Like caching and l

Apr 6, 2022
Yaconf - Yet Another Configurations Container

Yaconf - Yet Another Configurations Container A PHP Persistent Configurations Container Requirement PHP 7+ Introduction Yaconf is a configurations con

May 16, 2022
Here you have yet another framework for writing RESTful web services in PHP
Here you have yet another framework for writing RESTful web services in PHP

PHP-Rocker Here you have yet another framework for writing RESTful web services in PHP, jay! What sets this framework apart from many of the others is

May 19, 2022
Jump is yet another self-hosted startpage for your server designed to be simple, stylish, fast and secure.
Jump is yet another self-hosted startpage for your server designed to be simple, stylish, fast and secure.

Jump Jump is yet another self-hosted startpage for your server designed to be simple, stylish, fast and secure. Features Fast, easy to deploy, secure

May 28, 2022
Yet another asynchronous permission management plugin for PocketMine-MP.

GroupsAPI Yet another asynchronous permission management plugin for PocketMine-MP. Features Developer-friendly API Temporary rank/group support Multip

May 14, 2022
Multi-process coroutine edition Swoole spider !! Learn about Swoole's network programming and the use of its related APIs

swoole_spider php bin/spider // Just do it !! Cache use Swoole\Table; use App\Table\Cache; $table = new Table(1<<20); // capacity size $table->column

Apr 22, 2021
💫 Vega is a CLI mode HTTP web framework written in PHP support Swoole, WorkerMan / Vega 是一个用 PHP 编写的 CLI 模式 HTTP 网络框架,支持 Swoole、WorkerMan

Mix Vega 中文 | English Vega is a CLI mode HTTP web framework written in PHP support Swoole, WorkerMan Vega 是一个用 PHP 编写的 CLI 模式 HTTP 网络框架,支持 Swoole、Work

Apr 28, 2022
A easy way to install your basic yii projetc, we have encrypt database password in phpfile, my class with alot funtions to help you encrypt and decrypt and our swoole server install just run ./yii swoole/start and be happy!

Yii 2 Basic Project Template with swoole and Modules Yii 2 Basic Project Template is a skeleton Yii 2 application best for rapidly creating small proj

Apr 11, 2022
swoole,easyswoole,swoole framework
swoole,easyswoole,swoole framework

EasySwoole - A High Performance Swoole Framework EasySwoole is a distributed, persistent memory PHP framework based on the Swoole extension. It was cr

May 23, 2022
swoole and golang ipc, use goroutine complete swoole coroutine

swoole and golang ipc demo swoole process module exec go excutable file as sider car, use goroutine complete swoole coroutine hub.php <?php require '

Apr 17, 2022