Giter VIP home page Giter VIP logo

php-apm's People

Contributors

0livier avatar davidstrauss avatar johnkeates avatar mathieuk avatar patrickallaert avatar remicollet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-apm's Issues

[2.1.2] PHP 5 build is broken

/builddir/build/BUILD/php-pecl-apm-2.1.2/NTS/backtrace.c:381:8: error: 'IS_REFERENCE' undeclared (first use in this function)
   case IS_REFERENCE:
        ^~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-apm-2.1.2/NTS/backtrace.c:381:8: note: each undeclared identifier is reported only once for each function it appears in
/builddir/build/BUILD/php-pecl-apm-2.1.2/NTS/backtrace.c:382:4: warning: implicit declaration of function 'ZVAL_DEREF' [-Wimplicit-function-declaration]
    ZVAL_DEREF(expr);
    ^~~~~~~~~~

Bad version reported

From php -i

APM support => enabled
Version => 1.2.0alpha1

In apm.c

#define APM_VERSION "1.2.0alpha1"

Please use standard PHP_APM_VERSION in php_apm.h (good pratice, and IIRC, this is check during upload on PECL website)

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);

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.

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.

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

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

while trying to compile master I get the following error :

$ make
/bin/bash /tmp/php-apm-master/libtool --mode=compile cc  -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-apm-master/apm.c -o apm.lo 
libtool: compile:  cc -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /tmp/php-apm-master/apm.c  -fPIC -DPIC -o .libs/apm.o
/bin/bash /tmp/php-apm-master/libtool --mode=compile cc  -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-apm-master/backtrace.c -o backtrace.lo 
libtool: compile:  cc -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /tmp/php-apm-master/backtrace.c  -fPIC -DPIC -o .libs/backtrace.o
/bin/bash /tmp/php-apm-master/libtool --mode=compile cc  -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-apm-master/driver_sqlite3.c -o driver_sqlite3.lo 
libtool: compile:  cc -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /tmp/php-apm-master/driver_sqlite3.c  -fPIC -DPIC -o .libs/driver_sqlite3.o
/bin/bash /tmp/php-apm-master/libtool --mode=compile cc  -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-apm-master/driver_mysql.c -o driver_mysql.lo 
libtool: compile:  cc -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /tmp/php-apm-master/driver_mysql.c  -fPIC -DPIC -o .libs/driver_mysql.o
/bin/bash /tmp/php-apm-master/libtool --mode=compile cc  -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql  -DHAVE_CONFIG_H  -g -O2   -c /tmp/php-apm-master/driver_statsd.c -o driver_statsd.lo 
libtool: compile:  cc -I. -I/tmp/php-apm-master -DPHP_ATOM_INC -I/tmp/php-apm-master/include -I/tmp/php-apm-master/main -I/tmp/php-apm-master -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql -DHAVE_CONFIG_H -g -O2 -c /tmp/php-apm-master/driver_statsd.c  -fPIC -DPIC -o .libs/driver_statsd.o
/tmp/php-apm-master/driver_statsd.c: In function 'apm_driver_statsd_want_event':
/tmp/php-apm-master/driver_statsd.c:39:1: error: 'zend_apm_statsd_globals' has no member named 'process_silenced_events'
make: *** [driver_statsd.lo] Erreur 1

$ phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212

$ php -v
PHP 5.5.10-1+deb.sury.org~precise+1 (cli) (built: Mar 27 2014 16:16:25) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

Bad configure message.

PHP_ARG_WITH(debugfile, enable support for MySQL,
[  --with-debugfile=[FILE] Location of debugging file (/tmp/apm.debug by default)], no, no)

"enable support for MySQL" is obviously a copy/paste error.

During configure

...
checking enable support for MySQL... yes
checking enable support for statsd... yes
checking enable support for socket... yes
checking enable support for MySQL... no

The last one is a bit confusing ;)

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.

Build failure with PHP 7.3

Compiling php-apm on CentOS 7 server with PHP 7.3.7 (installed from IUS yum repo) is failing. Here are steps to reproduce the problem:

phpize
 ./configure --without-sqlite3 --without-mysql --disable-socket

And here's the error I'm getting:

/bin/sh /home/user/APM/libtool --mode=compile cc  -I. -I/home/user/APM -DPHP_ATOM_INC -I/home/user/APM/include -I/home/user/APM/main -I/home/user/APM -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /home/user/APM/backtrace.c -o backtrace.lo 
libtool: compile:  cc -I. -I/home/user/APM -DPHP_ATOM_INC -I/home/user/APM/include -I/home/user/APM/main -I/home/user/APM -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/user/APM/backtrace.c  -fPIC -DPIC -o .libs/backtrace.o
/home/user/APM/backtrace.c: In function 'append_flat_zval_r':
/home/user/APM/backtrace.c:391:79: error: 'struct <anonymous>' has no member named 'nApplyCount'
    if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) && ++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
                                                                               ^
/home/user/APM/backtrace.c:397:26: error: 'struct <anonymous>' has no member named 'nApplyCount'
     Z_ARRVAL_P(expr)->u.v.nApplyCount--;
                          ^
/home/user/APM/backtrace.c:407:26: error: 'struct <anonymous>' has no member named 'nApplyCount'
     Z_ARRVAL_P(expr)->u.v.nApplyCount--;
                          ^
make: *** [backtrace.lo] Error 1

I'd appreciate help in debugging this problem. Thank you.

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

dose not support PHP 5.3.29

hi @patrickallaert

root@miaohong01:/home/test/php-apm# phpize 
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

root@miaohong01:/home/test/php-apm# php --version
PHP 5.3.29 (cli) (built: Oct 20 2015 17:09:06) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies

got these errors

/home/test/php-apm/backtrace.c: In function ‘append_backtrace’:
/home/test/php-apm/backtrace.c:186:6: warning: passing argument 2 of ‘zend_get_object_classname’ from incompatible pointer type [enabled by default]
/mh/phphook/php/include/php/Zend/zend_API.h:331:14: note: expected ‘char **’ but argument is of type ‘const char **’
/home/test/php-apm/backtrace.c:221:28: error: ‘znode’ has no member named ‘constant’
/home/test/php-apm/backtrace.c: In function ‘append_flat_zval_r’:
/home/test/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/test/php-apm/backtrace.c:421:5: note: expected ‘char **’ but argument is of type ‘const char **’
make: *** [backtrace.lo] Error 1

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 ^^)

Build failure with modern GCC

Using GCC 10

/usr/bin/ld: .libs/backtrace.o:(.bss+0x0): multiple definition of apm_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)

can't load extension

when restart php-fpm,occur the error:
NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/opt/modules/php5.6/lib/php/extensions/no-debug-non-zts-20131226/apm.so' - /opt/modules/php5.6/lib/php/extensions/no-debug-non-zts-20131226/apm.so: undefined symbol: core_globals_id in Unknown on line 0

Documentation and SQL create queries

Hi,

I'm trying to configure APM on my local machine but I'm a bit put off by the lack of documentation. Is there any documentation outside of the source code, explaining how we're supposed to setup and check if the extension is actually doing anything? I see the wiki is empty and there's no doc/ folder. The README focuses on installing but it doesn't give much information about how to manage issues, so I was looking for someplace else to find the info but couldn't.

I've initially installed it with SQLite3 because I didn't understand why it wouldn't compile with MariaDB support if the (PECL installer) menu clearly offers MySQL/MariaDB and I had both libmariadbd-dev and libmariadb-client-lgpl-dev installed (on Ubuntu), but then I realized (after installing it with the SQLite driver) that maybe it was specifically asking for the MySQL dev packages, and indeed, installing libmysqld-dev and libmysqlclient-dev, I "pecl uninstall"ed APM and then it installed with MySQL/MariaDB support.

Then (probably because of the weird install/uninstall/install steps, it installed but did not create the database structure. I had to go find the CREATE TABLE queries in driver_mysql.c (pasting them below for a copy-paste by others, maybe that will help).

Finally, now I'm up with php-apm installed, php-apm-web install (and it loads the index) and I've enabled APM in one of my PHP applications, but I can see no data in either the event, request or stats tables.

So my initial question remains: how do I know if it's doing something?

Here is the copy paste of the MySQL tables CREATE queries:

CREATE TABLE IF NOT EXISTS request (
    id INTEGER UNSIGNED PRIMARY KEY auto_increment,
    application VARCHAR(255) NOT NULL,
    ts TIMESTAMP NOT NULL,
    script TEXT NOT NULL,
    uri TEXT NOT NULL,
    host TEXT NOT NULL,
    ip INTEGER UNSIGNED NOT NULL,
    cookies TEXT NOT NULL,
    post_vars TEXT NOT NULL,
    referer TEXT NOT NULL,
    method TEXT NOT NULL
);

CREATE TABLE IF NOT EXISTS event (
    id INTEGER UNSIGNED PRIMARY KEY auto_increment,
    request_id INTEGER UNSIGNED,
    ts TIMESTAMP NOT NULL,
    type SMALLINT UNSIGNED NOT NULL,
    file TEXT NOT NULL,
    line MEDIUMINT UNSIGNED NOT NULL,
    message TEXT NOT NULL,
    backtrace BLOB NOT NULL,
    KEY request (request_id)
);

CREATE TABLE IF NOT EXISTS stats (
    id INTEGER UNSIGNED PRIMARY KEY auto_increment,
    request_id INTEGER UNSIGNED,
    duration FLOAT UNSIGNED NOT NULL,
    user_cpu FLOAT UNSIGNED NOT NULL,
    sys_cpu FLOAT UNSIGNED NOT NULL,
    mem_peak_usage INTEGER UNSIGNED NOT NULL,
    KEY request (request_id)
);

Unable to install from source on CentOS 7

[root@localhost php-apm]# rpm -qa | grep php
php70w-pdo-7.0.10-1.w7.x86_64
php70w-mcrypt-7.0.10-1.w7.x86_64
php70w-common-7.0.10-1.w7.x86_64
php70w-devel-7.0.10-1.w7.x86_64
php70w-fpm-7.0.10-1.w7.x86_64
php70w-gd-7.0.10-1.w7.x86_64
php70w-snmp-7.0.10-1.w7.x86_64
php70w-process-7.0.10-1.w7.x86_64
php70w-mysql-7.0.7-1.w7.x86_64
php70w-cli-7.0.10-1.w7.x86_64
php70w-7.0.10-1.w7.x86_64
php70w-xml-7.0.10-1.w7.x86_64
php70w-pear-1.10.1-1.w7.noarch

[root@localhost php-apm]# rpm -qa | grep maria
mariadb-libs-5.5.50-1.el7_2.x86_64
mariadb-5.5.50-1.el7_2.x86_64
mariadb-server-5.5.50-1.el7_2.x86_64
mariadb-devel-5.5.50-1.el7_2.x86_64

[root@localhost php-apm]# ./configure --with-php-config=/usr/bin/php-config --with-sqlite3=no --with-mysql=/usr/lib64/mysql --enable-socket=no --enable-statsd=no
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 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 whether cc understands -c and -o together... yes
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-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.14.3 (ok)
checking for gawk... gawk
checking whether to enable apm support... yes, shared
checking enable support for sqlite3... no
checking enable support for MySQL... /usr/lib64/mysql
checking enable support for statsd... no
checking enable support for socket... no
checking enable the debug file... no
checking set default sqlite3 default DB path... no
checking for the location of libz... no
configure: error: Cannot find libmysqlclient under /usr.

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...

db password leaked in phpinfo()

I think it's from this line:

STD_PHP_INI_ENTRY("apm.mysql_pass", "", PHP_INI_PERDIR, OnUpdateString, mysql_db_pass, zend_apm_globals, apm_globals)

This results in:

screen shot 2017-04-16 at 11 19 50 pm-2

I know I can disable phpinfo, but I wondered if there was a way to obfuscate or bcrypt it before output?

Thanks
James

make: *** [apm.la] Error 1

OS

macOS 10.12.4 (16E195)

installation

./configure --enable-apm \
--with-php-config=/usr/local/Cellar/php56/5.6.30_6/bin/php-config 
--with-mysql=/usr/local/Cellar/mysql/5.7.16/

error

/driver_socket.o  -L/usr/local/Cellar/mysql/5.7.16//lib -lmysqlclient -lsqlite3  -Wl,-rpath -Wl,/usr/local/Cellar/mysql/5.7.16//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

does not support php 5.2.17

hi @patrickallaert

the php version:

root@miaohong01:/home/test/php-apm# php --version
PHP 5.2.17 (cli) (built: Oct 20 2015 15:22:17) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies


root@miaohong01:/home/test/php-apm# phpize 
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519

got these errors

/home/test/php-apm/apm.c:64:1: error: unknown type name ‘user_opcode_handler_t’
/home/test/php-apm/apm.c:64:67: warning: initialization makes integer from pointer without a cast [enabled by default]
/home/test/php-apm/apm.c:65:1: error: unknown type name ‘user_opcode_handler_t’
/home/test/php-apm/apm.c:65:65: warning: initialization makes integer from pointer without a cast [enabled by default]
/home/test/php-apm/apm.c: In function ‘apm_begin_silence_opcode_handler’:
/home/test/php-apm/apm.c:80:37: error: called object ‘_orig_begin_silence_opcode_handler’ is not a function
/home/test/php-apm/apm.c: In function ‘apm_end_silence_opcode_handler’:
/home/test/php-apm/apm.c:91:35: error: called object ‘_orig_end_silence_opcode_handler’ is not a function
/home/test/php-apm/apm.c: In function ‘zm_startup_apm’:
/home/test/php-apm/apm.c:302:38: warning: assignment makes integer from pointer without a cast [enabled by default]
/home/test/php-apm/apm.c:305:36: warning: assignment makes integer from pointer without a cast [enabled by default]
make: *** [apm.lo] Error 1

Build failure with 7.0.0beta2

During the build (master):

/tmp/php-apm/apm.c:72:3: warning: implicit declaration of function 'ZEND_VM_DISPATCH_TO_HELPER' [-Wimplicit-function-declaration]
...
/tmp/php-apm/driver_sqlite3.c:194:2: warning: implicit declaration of function 'Z_TYPE_PP' [-Wimplicit-function-declaration]

Try to load the extension:

 $ php -n -d extension=modules/apm.so -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'modules/apm.so' - modules/apm.so: undefined symbol: Z_TYPE_PP in Unknown on line 0

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.

Wrong duration value after apm.event_enabled is set to "0"

Hi,

apm.event_enabled="0"
apm.mysql_enabled=On
apm.mysql_stats_enabled=On

with this settings in apm.ini file I am getting wrong duration values (something like 1519402509) in the stats table, but with apm.event_enabled="1" duration values are correct.

After little investigation I have changed code in the apm.c file like this and an issue was disappeared.

diff apm.c apm_orig.c
355c355
< // if (APM_G(event_enabled)) {

> if (APM_G(event_enabled)) {
362c362
< // }

> }

Is the above patch correct or am I missing something?

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.

Don't get start

Hello there !! @patrickallaert @0livier @davidstrauss @remicollet @mathieuk
I am sorry for the inconvience to inform you that i have done everything as documented and can find the web view but the the extension isnot being started.
How am i supposed to use it . How does it even get started and show me evaluation of monitoring datas. ?
If json.so isnot commneted out from ini it throws "PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/apm.so' - /usr/lib/php/20131226/apm.so: undefined symbol: php_json_encode in Unknown on line 0"
But if i enable the extension before apm.so it throws "PHP Warning: Module 'json' already loaded in Unknown on line 0"
The APM is also not being showm on phpinfo();

cant get APM to Log the stuff in PHP7.0 FPM

Hi
I would like to add APM to my applications
But somehow the database tables aren't created during the run of the scripts.
I have enabled the opcache of php7
I also have the tideways profiler installed.

heres my php-fpm pool config

[cp]
user = #########
group = ##########
listen = /home/####################/run/php.sock
listen.owner = ############
listen.group = ##############
listen.mode = 0660
pm = dynamic
pm.max_children = 30
pm.start_servers = 4
pm.min_spare_servers = 4
pm.max_spare_servers = 8
php_flag[display_errors] = off
php_admin_value[error_log] = /home/##########/logs/php5-fpm.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 512M
php_admin_value[opcache.file_cache] = "/home/############"
php_admin_value[apm.mysql_enabled]=1
php_admin_value[apm.mysql_error_reporting]=E_ALL|E_STRICT
php_admin_value[apm.mysql_host]=localhost
php_admin_value[apm.mysql_user]=###########
php_admin_value[apm.mysql_pass]=#######################
php_admin_value[apm.mysql_db]=##########
php_admin_value[apm.socket_path]=/home/##########/run/php-apm.sock
php_admin_value[apm.application_id]=#####################
php_admin_value[apm.socket_enabled]=0
php_admin_value[apm.sqlite_enabled]=0
php_admin_value[apm.statsd_enabled]=0
php_admin_value[apm.mysql_port]=3306

where is my mistake?

New release please

Had to learn it the hard way that 2.0.5 would not compile with PHP7. If you could issue a new alpha/beta/whatever release based on master it could save others quite some time when trying to compile apm.

Or please give a hint in the readme that only master fits PHP7.

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.