PHP APM (Alternative PHP Monitor)

Overview

APM (Alternative PHP Monitor)

Build Status

APM (Alternative PHP Monitor) is a monitoring extension enabling native Application Performance Management (APM) for PHP. It doesn't require any modification to your application's code and let's you collect performance metrics as well as catching issues that may arise.

Installing

From PECL:

  1. $ sudo pecl install apm

From source:

  1. $ git clone https://github.com/patrickallaert/php-apm.git

  2. $ cd php-apm

  3. $ phpize

  4. Configure the extension, by default, sqlite3, MariaDB/MySQL, StatsD and Socket support are enabled:

    $ ./configure [--with-sqlite3[=DIR]] [--with-mysql[=DIR]] [--enable-statsd] [--enable-socket] [--with-debugfile[=FILE]]
    

    To disable the support of a --with-* switch, use: --without-*, example: $ ./configure --without-sqlite3 To disable the support of a --enable-* switch, use: --disable-*, example: $ ./configure --disable-socket

  5. Compile it:

    $ make [-j]
    

    Tip: use -j to activate parallel compilation.

  6. Install it:

    $ sudo make install
    

Upgrading

From 2.0 to 2.1

MariaDB / MySQL

ALTER TABLE request ADD COLUMN method TEXT NOT NULL;

SQLite

ALTER TABLE request ADD COLUMN method TEXT NOT NULL DEFAULT '';

Configuration

Common

  1. Activate the extension in the php configuration by adding:

    extension=apm.so

    Note: APM depends on JSON, so the apm.so extension must be loaded after JSON!

MariaDB/MySQL driver

The MariaDB/MySQL driver lets you store errors and stats in a local, remote or shared database.

  1. Create a user/database for storing APM events.

  2. Set the following settings in the php configuration:

    apm.mysql_enabled=1
    ; Error reporting level specific to the MariaDB/MySQL driver, same level as for PHP's *error_reporting*
    apm.mysql_error_reporting=E_ALL|E_STRICT
    apm.mysql_host=<host>
    ;apm.mysql_port=<port>
    apm.mysql_user=<user>
    apm.mysql_pass=<password>
    apm.mysql_db=<dbname>

SQLite driver

The SQLite driver lets you store errors and stats in a local SQLite database.

Note that if performance matters, you should better use the MariaDB/MySQL driver.

  1. Create the directory for the SQLite database as it will be referenced in the setting: apm.sqlite_db_path (see next step):

    $ mkdir -p /var/php/apm/db/
    $ chmod a+rwx /var/php/apm/db/
    
  2. Set the following settings in the php configuration:

    apm.sqlite_enabled=1
    ; The directory containing the "events" file
    apm.sqlite_db_path="/path/to/directory/configured/in/previous/step."
    ; Error reporting level specific to the SQLite3 driver, same level as for PHP's *error_reporting*
    apm.sqlite_error_reporting=E_ALL|E_STRICT

StatsD driver

The StatsD driver is handy to send performance metrics of your web sites/applications directly to StatsD, without interfering with your code. The most common backend for StatsD is Graphite, see [Etsy's blog post on StatsD/Graphite], but other backends exist as well.

  1. Install StatsD.

  2. Configure it in the php configuration:

    ; Whether to enable the statsd driver
    apm.statsd_enabled=On
    ; Host of the statsd server
    apm.statsd_host=localhost
    ; Port of the statsd server
    apm.statsd_port=3306

Socket driver

The socket driver lets you send errors and stats directly by Unix and/or TCP sockets. This is handy if you want to write you own piece of code to handle those.

  1. Configure it in the php configuration:

    ; Whether to enable the socket driver
    apm.socket_enabled=On
    ; Socket path (accept multiple entries, separated by "|", prefixed with "file:" or "tcp:")
    ; Example: apm.socket_path=file:/var/tmp/apm.sock|tcp:localhost:1234
    apm.socket_path=file:/tmp/apm.sock

Web frontend

The web frontend to visualize the data is now available at: https://github.com/patrickallaert/php-apm-web

Advanced configuration

; Application identifier, helps identifying which application is being monitored
apm.application_id="My application"
; Enable the capture of events such as errors, notices, warnings,...
apm.event_enabled=On|Off
; Maximum duration in ms a request can take before it gets recorded
apm.stats_duration_threshold="100"
; Maximum User CPU time in ms a request can take before it gets recorded
apm.stats_user_cpu_threshold="100"
; Maximum System CPU time in ms a request can take before it gets recorded
apm.stats_sys_cpu_threshold="10"
; Boolean controlling whether the stacktrace should be stored or not
apm.store_stacktrace=On|Off
; Boolean controlling whether the ip should be stored or not
apm.store_ip=On|Off
; Boolean controlling whether the cookies should be stored or not
apm.store_cookies=On|Off
; Boolean controlling whether the POST variables should be stored or not
apm.store_post=On|Off
; Maximum recursion depth used when dumping a variable
; NOTE: With today's application complexity, the amount of data collected in stacktraces
; including arguments can lead to several thousands of MiB of memory consumed.
; We recommend increasing this value with care.
apm.dump_max_depth=1

; For the configuration below, <driver_name> can be any of: sqlite, mysql, statsd or socket

; Activate or deactivate a specific driver (note also that it must be compiled in to be activated).
apm.<driver_name>_enabled=On|Off
; Whether to collect stats for this driver (ATTENTION: Has a small performance overhead when used with a DB drivers!)
apm.<driver_name>_stats_enabled=On|Off
; Error reporting level specific to this driver
apm.<driver_name>_error_reporting=E_ALL|E_STRICT
; Control which exceptions to collect (0: none exceptions collected, 1: collect uncaught exceptions (default), 2: collect ALL exceptions)
apm.<driver_name>_exception_mode=1
; Stores silenced events (Errors, warnings, notices,... that are muted with the PHP '@' operator)
apm.<driver_name>_process_silenced_events=On|Off

For a list of all PHP ini directives, take a look at the apm.ini file.

Common issues

  • SQLite database isn't created: this usually happens when your webserver or PHP process (fcgi, fpm) has no filesystem access:

    • Check your configuration: maybe SQLite isn't configured properly for APM
    • Check permissions on the directory and events file for the user that PHP runs as (sometimes it's your webserver user)
    • Check open_basedir restrictions
  • Not all data on the specific PHP scripts in which errors occur is collected:

    • Usually an access issue, check permissions
    • Sometimes this is due to open_basedir restrictions
  • APM is configured correctly, but nothing shows up, and phpinfo() doesn't show anyting related to APM:

    • APM wasn't actually loaded, check if the ini file you configured is actually used by PHP
    • the APM module was tried, but fatal errors prevented it from loading; check the PHP error log, usually a dependency like JSON wasn't loaded yet
Comments
  • None drivers supported on Windows

    None drivers supported on Windows

    Hello, I've just tried today the new release 2.0.3 on a Windows 32 platform, but none drivers seems supported.

    My checks are :

    • on both API, CLI and Apache module, I got same results
    • php-apm is loaded
    • INI entries are only
    APM support => enabled
    Version => 2.0.3
    
    Directive => Local Value => Master Value
    apm.enabled => On => On
    apm.application_id => My application => My application
    apm.event_enabled => On => On
    apm.store_stacktrace => On => On
    apm.store_ip => On => On
    apm.store_cookies => On => On
    apm.store_post => On => On
    apm.stats_duration_threshold => 100 => 100
    apm.dump_max_depth => 1 => 1
    

    even if I add some new ones in my php.ini (CLI or Apache) like

    [apm]
    apm.sqlite_enabled=1
    ; The directory containing the "events" file
    apm.sqlite_db_path="/var/php/apm/"
    ; Error reporting level specific to the SQLite3 driver, same level as for PHP's *error_reporting*
    apm.sqlite_error_reporting=E_ALL|E_STRICT 
    
    • Folder /var/php/apm is created on my C drive
    • SQLite driver is activated extension=php_sqlite3.dll
    opened by llaville 18
  • PHP Module Priority & DB issues

    PHP Module Priority & DB issues

    Running into the following error:

    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/apm.so' - /usr/lib/php5/20121212/apm.so: undefined symbol: php_json_encode in Unknown on line 0
    

    I thought it had to do with the loading order of the modules, json coming after the apm but even when I set apm to 30 priority I still get the error.

    opened by mrconnerton 9
  • APM not loading

    APM not loading

    I can't seem to get APM to load.

    I put the following lines in apm.ini:

    extension=apm.so apm.enabled="1" apm.sqlite_enabled=On apm.sqlite_stats_enabled=Off apm.sqlite_error_reporting=E_ALL|E_STRICT apm.sqlite_exception_mode=1 apm.sqlite_process_silenced_events = On apm.sqlite_db_path="/var/php/apm/db" apm.sqlite_max_event_insert_timeout="100"

    made sure PHP loads it (it is displayed in phpinfo(); as an additional parsed ini as with most other extensions), made sure apm.so is in the right location, checked logs, but nothing happens.

    No events database is created, the extension isn't displayed in phpinfo(); and nothing gets logged about apm anywhere.

    Using PHP 5.6.7.

    opened by johnkeates 6
  • Make error in backtrace

    Make error in backtrace

    /home/zhoupeiyuan/php-apm/php-apm/backtrace.c: In function 'append_backtrace': /home/zhoupeiyuan/php-apm/php-apm/backtrace.c:186:6: warning: passing argument 2 of 'zend_get_object_classname' from incompatible pointer type [enabled by default] /usr/include/php5/Zend/zend_API.h:326:14: note: expected 'char *' but argument is of type 'const char *' /home/zhoupeiyuan/php-apm/php-apm/backtrace.c:221:28: error: 'znode' has no member named 'constant' /home/zhoupeiyuan/php-apm/php-apm/backtrace.c: In function 'append_flat_zval_r': /home/zhoupeiyuan/php-apm/php-apm/backtrace.c:421:5: warning: passing argument 2 of 'expr->value.obj.handlers->get_class_name' from incompatible pointer type [enabled by default] /home/zhoupeiyuan/php-apm/php-apm/backtrace.c:421:5: note: expected 'char *' but argument is of type 'const char *' make: *** [backtrace.lo] Error 1

    I don't know which step goes wrong...

    opened by sib8th 5
  • Bad role - to be discussed

    Bad role - to be discussed

    I think the role of lot of files need to be changed.

    name="apm.ini" role="data" => "doc" seems better, no need to create a pear/data/apm.ini which is not used.

    web/* => some have role="php", so install in php_dir(=/usr/share/pear or something in the include path), some have role="data" so installed in data_dir (=/usr/share/pear-data or something outside the include path). I don't think this will result in a working webapp ;)

    Probably "all' should be role="www" to be installed in www_dir (=/var/www/html or something served by the webserver).

    name="web/config/db.php" role="php" this one should probably be role="cfg", so installed in cfg_dir (=/etc/pear). In this case, the package.xml should use a task/replace to correctly set "cfg_dir" during install :

    <file name="db.php" role="cfg">
         <tasks:replace from="@cfg_dir@" to="cfg_dir" type="pear-config" />
    </file>
    

    And the code must be aware of this to allow working from sources tree or from install tree.

    if ('@cfg_dir@' == '@'.'cfg_dir@') {
        $conf = __DIR__ . '/../config/db.php'; // sources tree
    } else {
        $conf = '@cfg_dir@/apm/config/db.php'; // pear install tree
    }
    new APM\Repository(require $conf);
    
    opened by remicollet 4
  • How to improve performance when there is lots of MySQL insert

    How to improve performance when there is lots of MySQL insert

    Hello,

    I think APM is not very suitable in production, because it insert MySQL in a synchrone way. How do you think we should handle that ?

    My proposition is to add a daemon mode to push all informations over an udp socket so anyone can write his own daemon (and maybe someone will share it ^^)

    opened by syrm 3
  • PHP7 symbol error for json_encode

    PHP7 symbol error for json_encode

    Hi,

    Build works on Xenial under PHP7, but it looks like after compile, making tests runs into issues...

    # make test
    
    Build complete.
    Don't forget to run 'make test'.
    
    /usr/bin/php7.0: symbol lookup error: /opt/php-apm/modules/apm.so: undefined symbol: php_json_encode
    /usr/bin/php7.0: symbol lookup error: /opt/php-apm/modules/apm.so: undefined symbol: php_json_encode
    
    =====================================================================
    PHP         : /usr/bin/php7.0 
    PHP_SAPI    : cli
    PHP_VERSION : 7.0.4-7ubuntu2
    ZEND_VERSION: 3.0.0
    PHP_OS      : Linux - Linux lewis-HP-ENVY-17-Notebook-PC 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64
    INI actual  : /opt/php-apm/tmp-php.ini
    More .INIs  :   
    CWD         : /opt/php-apm
    Extra dirs  : 
    VALGRIND    : Not used
    =====================================================================
    TIME START 2016-05-02 09:27:30
    =====================================================================
    FAIL Backtrace test [tests/backtrace.phpt] 
    FAIL Parse error test [tests/parse.phpt] 
    =====================================================================
    TIME END 2016-05-02 09:27:30
    
    =====================================================================
    TEST RESULT SUMMARY
    ---------------------------------------------------------------------
    Exts skipped    :    0
    Exts tested     :   14
    ---------------------------------------------------------------------
    
    Number of tests :    2                 2
    Tests skipped   :    0 (  0.0%) --------
    Tests warned    :    0 (  0.0%) (  0.0%)
    Tests failed    :    2 (100.0%) (100.0%)
    Expected fail   :    0 (  0.0%) (  0.0%)
    Tests passed    :    0 (  0.0%) (  0.0%)
    ---------------------------------------------------------------------
    Time taken      :    0 seconds
    =====================================================================
    
    =====================================================================
    FAILED TEST SUMMARY
    ---------------------------------------------------------------------
    Backtrace test [tests/backtrace.phpt]
    Parse error test [tests/parse.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]: s
    Please send /opt/php-apm/php_test_results_20160502_0927.txt to [email protected] manually, thank you.
    
    
    opened by Lewiscowles1986 3
  • Make error: duplicate symbol for architecture x86_64

    Make error: duplicate symbol for architecture x86_64

    ip-10-0-1-123:php-apm jashk$ make -j /bin/sh /Users/jashk/dev/php-apm/libtool --mode=link cc -DPHP_ATOM_INC -I/Users/jashk/dev/php-apm/include -I/Users/jashk/dev/php-apm/main -I/Users/jashk/dev/php-apm -I/usr/local/Cellar/php55/5.5.25/include/php -I/usr/local/Cellar/php55/5.5.25/include/php/main -I/usr/local/Cellar/php55/5.5.25/include/php/TSRM -I/usr/local/Cellar/php55/5.5.25/include/php/Zend -I/usr/local/Cellar/php55/5.5.25/include/php/ext -I/usr/local/Cellar/php55/5.5.25/include/php/ext/date/lib -I/usr/local/include/mysql -DHAVE_CONFIG_H -g -O2 -o apm.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/jashk/dev/php-apm/modules apm.lo backtrace.lo driver_sqlite3.lo driver_mysql.lo driver_statsd.lo driver_socket.lo -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lmysqlclient -lsqlite3 cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/apm.so -bundle .libs/apm.o .libs/backtrace.o .libs/driver_sqlite3.o .libs/driver_mysql.o .libs/driver_statsd.o .libs/driver_socket.o -L/usr/local/lib -lmysqlclient -lsqlite3 -Wl,-rpath -Wl,/usr/local/lib duplicate symbol _apm_globals in: .libs/apm.o .libs/backtrace.o ld: 1 duplicate symbol for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [apm.la] Error 1

    ip-10-0-1-123:php-apm jashk$ phpize Configuring for: PHP Api Version: 20121113 Zend Module Api No: 20121212 Zend Extension Api No: 220121212

    ip-10-0-1-123:php-apm jashk$ php -v PHP 5.5.25 (cli) (built: May 15 2015 09:30:28) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

    bug 
    opened by jashk 3
  • ZTS build is broken

    ZTS build is broken

    /dev/shm/BUILD/php-pecl-apm-2.0.0/ZTS/driver_statsd.c: In function 'apm_driver_statsd_is_enabled':
    /dev/shm/BUILD/php-pecl-apm-2.0.0/ZTS/driver_statsd.c:41:601: error: 'tsrm_ls' undeclared (first use in this function)
     APM_DRIVER_CREATE(statsd)
    

    And tons of other tsrm_ls related error.

    opened by remicollet 3
  • make: *** [backtrace.lo] Error 1

    make: *** [backtrace.lo] Error 1

    /bin/sh /root/php-apm-1.1.0rc2/libtool --mode=compile cc -I. -I/root/php-apm-1.1.0rc2 -DPHP_ATOM_INC -I/root/php-apm-1.1.0rc2/include -I/root/php-apm-1.1.0rc2/main -I/root/php-apm-1.1.0rc2 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/php-apm-1.1.0rc2/apm.c -o apm.lo mkdir .libs cc -I. -I/root/php-apm-1.1.0rc2 -DPHP_ATOM_INC -I/root/php-apm-1.1.0rc2/include -I/root/php-apm-1.1.0rc2/main -I/root/php-apm-1.1.0rc2 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/php-apm-1.1.0rc2/apm.c -fPIC -DPIC -o .libs/apm.o /bin/sh /root/php-apm-1.1.0rc2/libtool --mode=compile cc -I. -I/root/php-apm-1.1.0rc2 -DPHP_ATOM_INC -I/root/php-apm-1.1.0rc2/include -I/root/php-apm-1.1.0rc2/main -I/root/php-apm-1.1.0rc2 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/php-apm-1.1.0rc2/backtrace.c -o backtrace.lo cc -I. -I/root/php-apm-1.1.0rc2 -DPHP_ATOM_INC -I/root/php-apm-1.1.0rc2/include -I/root/php-apm-1.1.0rc2/main -I/root/php-apm-1.1.0rc2 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/php-apm-1.1.0rc2/backtrace.c -fPIC -DPIC -o .libs/backtrace.o /root/php-apm-1.1.0rc2/backtrace.c: In function ‘append_flat_hash’: /root/php-apm-1.1.0rc2/backtrace.c:337: error: too few arguments to function ‘apm_addslashes’ /root/php-apm-1.1.0rc2/backtrace.c: In function ‘append_variable’: /root/php-apm-1.1.0rc2/backtrace.c:379: error: too few arguments to function ‘apm_addslashes’ make: *** [backtrace.lo] Error 1

    PHP 5.5.7(zts) + Centos 6.5 x86_64

    bug 
    opened by movoin 3
  • APM 2.1.1 segmentation fault on PHP7 Debian Jessie

    APM 2.1.1 segmentation fault on PHP7 Debian Jessie

    I am getting a segfault with apm 2.1.1 when running on PHP 7.0.6-1~dotdeb+8.1. After doing a full backtrace with gdb this is what I'm getting:

    Program received signal SIGSEGV, Segmentation fault.
    0x00000000006d0962 in ?? ()
    (gdb) bt
    #0  0x00000000006d0962 in ?? ()
    #1  0x00000000006d21e8 in vspprintf ()
    #2  0x00007ffff4786de7 in apm_error_cb (type=8, error_filename=0x7ffff53f1518 "phar:///usr/local/bin/phpunit/phpunit/Util/ErrorHandler.php", error_lineno=85,
        format=0xcbe8ba "Array to string conversion", args=0x7fffff7ff620) at /tmp/pear/install/APM/apm.c:475
    #3  0x000000000046b70b in zend_error_noreturn ()
    #4  0x000000000072590b in _zval_get_string_func ()
    #5  0x000000000072c2b1 in zend_make_printable_zval ()
    #6  0x00007ffff478785b in append_variable (trace_str=0x7fffff7ff960, expr=0x7fffe5b619e8) at /tmp/pear/install/APM/backtrace.c:555
    #7  append_flat_zval_r (expr=0x7fffe5b619e8, trace_str=0x7fffff7ff960, depth=<optimized out>) at /tmp/pear/install/APM/backtrace.c:456
    #8  0x00007ffff478870c in debug_print_backtrace_args (arg_array=0x7fffff7ff8e0, trace_str=0x7fffff7ff960) at /tmp/pear/install/APM/backtrace.c:350
    #9  append_backtrace (trace_str=trace_str@entry=0x7fffff7ff960) at /tmp/pear/install/APM/backtrace.c:273
    #10 0x00007ffff4786d5a in process_event (event_type=event_type@entry=1, type=type@entry=8,
        error_filename=error_filename@entry=0x7ffff53f1518 "phar:///usr/local/bin/phpunit/phpunit/Util/ErrorHandler.php", error_lineno=error_lineno@entry=85,
        msg=0x7fffe5b95280 "Array to string conversion") at /tmp/pear/install/APM/apm.c:524
    #11 0x00007ffff4786e0b in apm_error_cb (type=8, error_filename=0x7ffff53f1518 "phar:///usr/local/bin/phpunit/phpunit/Util/ErrorHandler.php", error_lineno=85,
        format=0xcbe8ba "Array to string conversion", args=0x7fffff7ffa70) at /tmp/pear/install/APM/apm.c:479
    #12 0x000000000046b70b in zend_error_noreturn ()
    #13 0x000000000072590b in _zval_get_string_func ()
    #14 0x000000000072c2b1 in zend_make_printable_zval ()
    #15 0x00007ffff478785b in append_variable (trace_str=0x7fffff7ffdb0, expr=0x7fffe5b618a8) at /tmp/pear/install/APM/backtrace.c:555
    #16 append_flat_zval_r (expr=0x7fffe5b618a8, trace_str=0x7fffff7ffdb0, depth=<optimized out>) at /tmp/pear/install/APM/backtrace.c:456
    #17 0x00007ffff478870c in debug_print_backtrace_args (arg_array=0x7fffff7ffd30, trace_str=0x7fffff7ffdb0) at /tmp/pear/install/APM/backtrace.c:350
    #18 append_backtrace (trace_str=trace_str@entry=0x7fffff7ffdb0) at /tmp/pear/install/APM/backtrace.c:273
    #19 0x00007ffff4786d5a in process_event (event_type=event_type@entry=1, type=type@entry=8,
        error_filename=error_filename@entry=0x7ffff53f1518 "phar:///usr/local/bin/phpunit/phpunit/Util/ErrorHandler.php", error_lineno=error_lineno@entry=85,
        msg=0x7fffe5b95230 "Array to string conversion") at /tmp/pear/install/APM/apm.c:524
    #20 0x00007ffff4786e0b in apm_error_cb (type=8, error_filename=0x7ffff53f1518 "phar:///usr/local/bin/phpunit/phpunit/Util/ErrorHandler.php", error_lineno=85,
        format=0xcbe8ba "Array to string conversion", args=0x7fffff7ffec0) at /tmp/pear/install/APM/apm.c:479
    #21 0x000000000046b70b in zend_error_noreturn ()
    #22 0x000000000072590b in _zval_get_string_func ()
    #23 0x000000000072c2b1 in zend_make_printable_zval ()
    #24 0x00007ffff478785b in append_variable (trace_str=0x7fffff800200, expr=0x7fffe5b61768) at /tmp/pear/install/APM/backtrace.c:555
    #25 append_flat_zval_r (expr=0x7fffe5b61768, trace_str=0x7fffff800200, depth=<optimized out>) at /tmp/pear/install/APM/backtrace.c:456
    #26 0x00007ffff478870c in debug_print_backtrace_args (arg_array=0x7fffff800180, trace_str=0x7fffff800200) at /tmp/pear/install/APM/backtrace.c:350
    #27 append_backtrace (trace_str=trace_str@entry=0x7fffff800200) at /tmp/pear/install/APM/backtrace.c:273
    #28 0x00007ffff4786d5a in process_event (event_type=event_type@entry=1, type=type@entry=8,
        error_filename=error_filename@entry=0x7ffff53f1518 "phar:///usr/local/bin/phpunit/phpunit/Util/ErrorHandler.php", error_lineno=error_lineno@entry=85,
        msg=0x7fffe5b951e0 "Array to string conversion") at /tmp/pear/install/APM/apm.c:524
    #29 0x00007ffff4786e0b in apm_error_cb (type=8, error_filename=0x7ffff53f1518 "phar:///usr/local/bin/phpunit/phpunit/Util/ErrorHandler.php", error_lineno=85,
        format=0xcbe8ba "Array to string conversion", args=0x7fffff800310) at /tmp/pear/install/APM/apm.c:479
    #30 0x000000000046b70b in zend_error_noreturn ()
    #31 0x000000000072590b in _zval_get_string_func ()
    #32 0x000000000072c2b1 in zend_make_printable_zval ()
    #33 0x00007ffff478785b in append_variable (trace_str=0x7fffff800650, expr=0x7fffe5b61628) at /tmp/pear/install/APM/backtrace.c:555
    #34 append_flat_zval_r (expr=0x7fffe5b61628, trace_str=0x7fffff800650, depth=<optimized out>) at /tmp/pear/install/APM/backtrace.c:456
    

    Any ideas on what could be going wrong? I'm not running xDebug.

    opened by lgomezma 2
  • Unable to compile

    Unable to compile

    I would still like to use php-apm. Tried both pecl and compiling without sqllite3, see errors. Using Unbuntu 20.04 LTS with php 7.4 and mysql8

    Needs fixing I guess

    Pecl:

    # pecl install apm
    WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
    downloading APM-2.1.3.tgz ...
    Starting to download APM-2.1.3.tgz (33,188 bytes)
    .........done: 33,188 bytes
    14 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20190902
    Zend Module Api No:      20190902
    Zend Extension Api No:   320190902
    Enable Sqlite3 support [yes] :
    Enable MariaDB/MySQL support [yes] : ^C
    root@DESKTOP-U6O60I2:/mnt/d/BUAS/code/php-apm# pecl install apm
    WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
    downloading APM-2.1.3.tgz ...
    Starting to download APM-2.1.3.tgz (33,188 bytes)
    .........done: 33,188 bytes
    14 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20190902
    Zend Module Api No:      20190902
    Zend Extension Api No:   320190902
    Enable Sqlite3 support [yes] : no
    Enable MariaDB/MySQL support [yes] : yes
    Enable Socket support [yes] : yes
    Enable Statsd support [yes] : yes
    building in /tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3
    running: /tmp/pear/temp/APM/configure --with-php-config=/usr/bin/php-config --with-sqlite3=no --with-mysql --enable-socket=yes --enable-statsd=yes
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for pkg-config... no
    checking for cc... cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking target system type... x86_64-pc-linux-gnu
    checking for PHP prefix... /usr
    checking for PHP includes... -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib
    checking for PHP extension directory... /usr/lib/php/20190902
    checking for PHP installed headers prefix... /usr/include/php/20190902
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for gawk... gawk
    checking whether to enable apm support... yes, shared
    checking enable support for sqlite3... no
    checking enable support for MySQL... yes
    checking enable support for statsd... yes
    checking enable support for socket... yes
    checking enable the debug file... no
    checking set default sqlite3 default DB path... no
    checking for the location of libz... no
    checking for mysql_close in -lmysqlclient... yes
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for ld used by cc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for /usr/bin/ld option to reload object files... -r
    checking for BSD-compatible nm... /usr/bin/nm -B
    checking whether ln -s works... yes
    checking how to recognize dependent libraries... pass_all
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking the maximum length of command line arguments... 1572864
    checking command to parse /usr/bin/nm -B output from cc object... ok
    checking for objdir... .libs
    checking for ar... ar
    checking for ranlib... ranlib
    checking for strip... strip
    checking if cc supports -fno-rtti -fno-exceptions... no
    checking for cc option to produce PIC... -fPIC
    checking if cc PIC flag -fPIC works... yes
    checking if cc static flag -static works... yes
    checking if cc supports -c -o file.o... yes
    checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    
    creating libtool
    appending configuration tag "CXX" to libtool
    configure: patching config.h.in
    configure: creating ./config.status
    config.status: creating config.h
    running: make
    /bin/bash /tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/libtool --mode=compile cc  -I. -I/tmp/pear/temp/APM -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/include -I/tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/main -I/tmp/pear/temp/APM -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/APM/apm.c -o apm.lo
    mkdir .libs
     cc -I. -I/tmp/pear/temp/APM -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/include -I/tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/main -I/tmp/pear/temp/APM -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/APM/apm.c  -fPIC -DPIC -o .libs/apm.o
    /bin/bash /tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/libtool --mode=compile cc  -I. -I/tmp/pear/temp/APM -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/include -I/tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/main -I/tmp/pear/temp/APM -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/APM/backtrace.c -o backtrace.lo
     cc -I. -I/tmp/pear/temp/APM -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/include -I/tmp/pear/temp/pear-build-root19WaoW/APM-2.1.3/main -I/tmp/pear/temp/APM -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/APM/backtrace.c  -fPIC -DPIC -o .libs/backtrace.o
    /tmp/pear/temp/APM/backtrace.c: In function ‘append_flat_zval_r’:
    /tmp/pear/temp/APM/backtrace.c:391:8: warning: implicit declaration of function ‘ZEND_HASH_APPLY_PROTECTION’; did you mean ‘ZEND_HASH_APPLY_REMOVE’? [-Wimplicit-function-declaration]
      391 |    if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) && ++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~~
          |        ZEND_HASH_APPLY_REMOVE
    /tmp/pear/temp/APM/backtrace.c:391:79: error: ‘struct <anonymous>’ has no member named ‘nApplyCount’
      391 |    if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) && ++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
          |                                                                               ^
    /tmp/pear/temp/APM/backtrace.c:397:26: error: ‘struct <anonymous>’ has no member named ‘nApplyCount’
      397 |     Z_ARRVAL_P(expr)->u.v.nApplyCount--;
          |                          ^
    /tmp/pear/temp/APM/backtrace.c:407:26: error: ‘struct <anonymous>’ has no member named ‘nApplyCount’
      407 |     Z_ARRVAL_P(expr)->u.v.nApplyCount--;
          |                          ^
    /tmp/pear/temp/APM/backtrace.c:422:8: warning: implicit declaration of function ‘Z_OBJ_APPLY_COUNT_P’ [-Wimplicit-function-declaration]
      422 |    if (Z_OBJ_APPLY_COUNT_P(expr) > 0) {
          |        ^~~~~~~~~~~~~~~~~~~
    /tmp/pear/temp/APM/backtrace.c:447:5: warning: implicit declaration of function ‘Z_OBJ_INC_APPLY_COUNT_P’ [-Wimplicit-function-declaration]
      447 |     Z_OBJ_INC_APPLY_COUNT_P(expr);
          |     ^~~~~~~~~~~~~~~~~~~~~~~
    /tmp/pear/temp/APM/backtrace.c:457:5: warning: implicit declaration of function ‘Z_OBJ_DEC_APPLY_COUNT_P’ [-Wimplicit-function-declaration]
      457 |     Z_OBJ_DEC_APPLY_COUNT_P(expr);
          |     ^~~~~~~~~~~~~~~~~~~~~~~
    make: *** [Makefile:197: backtrace.lo] Error 1
    ERROR: `make' failed
    

    Compiling:

    php-apm# ./configure --without-sqlite3 --with-mysql=/usr/include/mysql
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for pkg-config... no
    checking for cc... cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking target system type... x86_64-pc-linux-gnu
    checking for PHP prefix... /usr
    checking for PHP includes... -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib
    checking for PHP extension directory... /usr/lib/php/20190902
    checking for PHP installed headers prefix... /usr/include/php/20190902
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for gawk... gawk
    checking whether to enable apm support... yes, shared
    checking enable support for sqlite3... no
    checking enable support for MySQL... /usr/include/mysql
    checking enable support for statsd... yes
    checking enable support for socket... yes
    checking enable the debug file... no
    checking set default sqlite3 default DB path... no
    checking for the location of libz... no
    checking for mysql_close in -lmysqlclient... yes
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for ld used by cc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for /usr/bin/ld option to reload object files... -r
    checking for BSD-compatible nm... /usr/bin/nm -B
    checking whether ln -s works... yes
    checking how to recognize dependent libraries... pass_all
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking the maximum length of command line arguments... 1572864
    checking command to parse /usr/bin/nm -B output from cc object... ok
    checking for objdir... .libs
    checking for ar... ar
    checking for ranlib... ranlib
    checking for strip... strip
    checking if cc supports -fno-rtti -fno-exceptions... no
    checking for cc option to produce PIC... -fPIC
    checking if cc PIC flag -fPIC works... yes
    checking if cc static flag -static works... yes
    checking if cc supports -c -o file.o... yes
    checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    
    creating libtool
    appending configuration tag "CXX" to libtool
    configure: patching config.h.in
    configure: creating ./config.status
    config.status: creating config.h
    root@DESKTOP-U6O60I2:/mnt/d/BUAS/code/php-apm# make
    /bin/bash /mnt/d/BUAS/code/php-apm/libtool --mode=compile cc  -I. -I/mnt/d/BUAS/code/php-apm -DPHP_ATOM_INC -I/mnt/d/BUAS/code/php-apm/include -I/mnt/d/BUAS/code/php-apm/main -I/mnt/d/BUAS/code/php-apm -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /mnt/d/BUAS/code/php-apm/apm.c -o apm.lo
    mkdir .libs
     cc -I. -I/mnt/d/BUAS/code/php-apm -DPHP_ATOM_INC -I/mnt/d/BUAS/code/php-apm/include -I/mnt/d/BUAS/code/php-apm/main -I/mnt/d/BUAS/code/php-apm -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /mnt/d/BUAS/code/php-apm/apm.c  -fPIC -DPIC -o .libs/apm.o
    /bin/bash /mnt/d/BUAS/code/php-apm/libtool --mode=compile cc  -I. -I/mnt/d/BUAS/code/php-apm -DPHP_ATOM_INC -I/mnt/d/BUAS/code/php-apm/include -I/mnt/d/BUAS/code/php-apm/main -I/mnt/d/BUAS/code/php-apm -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /mnt/d/BUAS/code/php-apm/backtrace.c -o backtrace.lo
     cc -I. -I/mnt/d/BUAS/code/php-apm -DPHP_ATOM_INC -I/mnt/d/BUAS/code/php-apm/include -I/mnt/d/BUAS/code/php-apm/main -I/mnt/d/BUAS/code/php-apm -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /mnt/d/BUAS/code/php-apm/backtrace.c  -fPIC -DPIC -o .libs/backtrace.o
    /mnt/d/BUAS/code/php-apm/backtrace.c: In function ‘append_flat_zval_r’:
    /mnt/d/BUAS/code/php-apm/backtrace.c:391:8: warning: implicit declaration of function ‘ZEND_HASH_APPLY_PROTECTION’; did you mean ‘ZEND_HASH_APPLY_REMOVE’? [-Wimplicit-function-declaration]
      391 |    if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) && ++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~~
          |        ZEND_HASH_APPLY_REMOVE
    /mnt/d/BUAS/code/php-apm/backtrace.c:391:79: error: ‘struct <anonymous>’ has no member named ‘nApplyCount’
      391 |    if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) && ++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
          |                                                                               ^
    /mnt/d/BUAS/code/php-apm/backtrace.c:397:26: error: ‘struct <anonymous>’ has no member named ‘nApplyCount’
      397 |     Z_ARRVAL_P(expr)->u.v.nApplyCount--;
          |                          ^
    /mnt/d/BUAS/code/php-apm/backtrace.c:407:26: error: ‘struct <anonymous>’ has no member named ‘nApplyCount’
      407 |     Z_ARRVAL_P(expr)->u.v.nApplyCount--;
          |                          ^
    /mnt/d/BUAS/code/php-apm/backtrace.c:422:8: warning: implicit declaration of function ‘Z_OBJ_APPLY_COUNT_P’ [-Wimplicit-function-declaration]
      422 |    if (Z_OBJ_APPLY_COUNT_P(expr) > 0) {
          |        ^~~~~~~~~~~~~~~~~~~
    /mnt/d/BUAS/code/php-apm/backtrace.c:447:5: warning: implicit declaration of function ‘Z_OBJ_INC_APPLY_COUNT_P’ [-Wimplicit-function-declaration]
      447 |     Z_OBJ_INC_APPLY_COUNT_P(expr);
          |     ^~~~~~~~~~~~~~~~~~~~~~~
    /mnt/d/BUAS/code/php-apm/backtrace.c:457:5: warning: implicit declaration of function ‘Z_OBJ_DEC_APPLY_COUNT_P’ [-Wimplicit-function-declaration]
      457 |     Z_OBJ_DEC_APPLY_COUNT_P(expr);
          |     ^~~~~~~~~~~~~~~~~~~~~~~
    make: *** [Makefile:197: backtrace.lo] Error 1
    
    opened by marinhekman 3
  • Build failure with modern GCC

    Build failure with modern GCC

    Using GCC 10

    /usr/bin/ld: .libs/backtrace.o:(.bss+0x0): multiple definition ofapm_globals'; .libs/apm.o:(.bss+0xc0): first defined here `

    BTW, don't know if this project is still alive, so a simple bug report (not a PR)

    opened by remicollet 1
  • Php7.3

    Php7.3

    ZEND_HASH_APPLY_PROTECTION and nApplyCount member are deprecated in php 7.3.

    From UPGRADING.INTERNALS

    c. Protection from recursion during processing circular data structures was refactored. HashTable.nApplyCount and IS_OBJ_APPLY_COUNT are replaced by single flag GC_PROTECTED. Corresponding macros Z_OBJ_APPLY_COUNT, Z_OBJ_INC_APPLY_COUNT, Z_OBJ_DEC_APPLY_COUNT, ZEND_HASH_GET_APPLY_COUNT, ZEND_HASH_INC_APPLY_COUNT, ZEND_HASH_DEC_APPLY_COUNT are replaced with GC_IS_RECURSIVE, GC_PROTECT_RECURSION, GC_UNPROTECT_RECURSION, Z_IS_RECURSIVE, Z_PROTECT_RECURSION, Z_UNPROTECT_RECURSION.

     HASH_FLAG_APPLY_PROTECTION flag and ZEND_HASH_APPLY_PROTECTION() macro
     are removed. All mutable arrays should use recursion protection.
     Corresponding checks should be replaced by Z_REFCOUNTED() or
     !(GC_GLAGS(p) & GC_IMMUTABLE).
    

    Found excellent examples here: https://news-web.php.net/php.cvs/99639

    I'm new to PHP internals, but thought I'd take a crack at this as I need to get it working with php7.3. It seems to have compiled, tested successfully, and is working correctly in the dev environment. I stumbled upon the inline hash protection function idea from PHP Mongo development team.
    https://github.com/mongodb/mongo-php-driver/commit/197f3f7a8a73391cbe489bc900b9f1f1d47d3341

    Also, a sincere thank you. This project is really a huge help. Impressive work! DV

    opened by VHDev 2
Zipkin PHP is the official PHP Tracer implementation for Zipkin

Zipkin PHP is the official PHP Tracer implementation for Zipkin, supported by the OpenZipkin community. Installation composer require openz

Open Zipkin 250 Nov 12, 2022
Debug bar for PHP

PHP Debug Bar Displays a debug bar in the browser with information from php. No more var_dump() in your code! Features: Generic debug bar Easy to inte

Maxime Bouroumeau-Fuseau 4k Jan 8, 2023
Xdebug — Step Debugger and Debugging Aid for PHP

Xdebug Xdebug is a debugging tool for PHP. It provides step-debugging and a whole range of development aids, such as stack traces, a code profiler, fe

Xdebug 2.8k Jan 3, 2023
Kint - a powerful and modern PHP debugging tool.

Kint - debugging helper for PHP developers What am I looking at? At first glance Kint is just a pretty replacement for var_dump(), print_r() and debug

null 2.7k Dec 25, 2022
😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

Tracy - PHP debugger Introduction Tracy library is a useful helper for everyday PHP programmers. It helps you to: quickly detect and correct errors lo

Nette Foundation 1.6k Dec 23, 2022
PHP Benchmarking framework

PHPBench is a benchmark runner for PHP analogous to PHPUnit but for performance rather than correctness. Features include: Revolutions: Repeat your co

PHPBench 1.7k Jan 2, 2023
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

Joe Watkins 841 Oct 9, 2022
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

Sidharth Kshatriya 709 Dec 30, 2022
PHP Debug Console

PHP Console A web console to try your PHP code into Creating a test file or using php's interactive mode can be a bit cumbersome to try random php sni

Jordi Boggiano 523 Nov 7, 2022
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

Renato Cassino 190 Dec 3, 2022
PCOV - CodeCoverage compatible driver for PHP

PCOV A self contained CodeCoverage compatible driver for PHP Requirements and Installation See INSTALL.md API /** * Shall start recording coverage in

Joe Watkins 613 Dec 21, 2022
Low-overhead sampling profiler for PHP 7+

phpspy phpspy is a low-overhead sampling profiler for PHP. For now, it works with Linux 3.2+ x86_64 non-ZTS PHP 7.0+ with CLI, Apache, and FPM SAPIs.

Adam 1.3k Dec 24, 2022
The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function that you can use instead of var_dump().

VarDumper Component The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function t

Symfony 7.1k Jan 1, 2023
PHP errors for cool kids

whoops PHP errors for cool kids whoops is an error handler framework for PHP. Out-of-the-box, it provides a pretty error interface that helps you debu

Filipe Dobreira 12.9k Dec 24, 2022
Clockwork - php dev tools in your browser - server-side component

Clockwork is a development tool for PHP available right in your browser. Clockwork gives you an insight into your application runtime - including requ

its 4.8k Dec 29, 2022
Laravel Debugbar (Integrates PHP Debug Bar)

Laravel Debugbar This is a package to integrate PHP Debug Bar with Laravel. It includes a ServiceProvider to register the debugbar and attach it to th

Barry vd. Heuvel 14.8k Jan 9, 2023
This package connects a Laravel Octance application with Tideways for PHP Monitoring, Profiling and Exception Tracking.

Tideways Middleware for Laravel Octane This package connects a Laravel Octance application with Tideways for PHP Monitoring, Profiling and Exception T

Tideways 7 Jan 6, 2022
A tool to profile mysql queries in php env.

MysqlQueryProfiler This tool helps you to quickly profile a mysql query in a PHP 7.4+ environnement. You can also compare 2 queries. This image shows

null 8 Jul 30, 2021
Datadog Tracing PHP Client

DD Trace PHP PHP Tracer Getting Started The Datadog PHP Tracer (ddtrace) brings APM and distributed tracing to PHP. Installing the extension Visit the

Datadog, Inc. 307 Jan 7, 2023