Skip to content

CLI模式可以正常上报数据,SAPI模式(php-fpm)不上报 #141

Description

@yetHandsome

molten.ini

[molten]
extension=molten.so
molten.enable="1"
molten.service_name="local"
molten.tracing_cli=1
molten.open_report=1
molten.sampling_type=2
molten.sampling_rate=1
molten.notify_uri="http://172.20.10.18:9411/zipkin/"
molten.sink_http_uri="http://172.20.10.18:9411/api/v1/spans"
molten.sink_type=4
molten.sink_log_path="/tmp/logs/"

nginx配置
zipkin.me.conf

server {
    listen 80;
    server_name  zipkin.me;
    root "/usr/local/src/Molten/example";

    location / {
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php;
    }

    location ~ \.php(.*)$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO  $fastcgi_path_info;
        fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
        include        fastcgi_params;
    }
}

php -m
405 Method Not Allowed[PHP Modules]
bz2
calendar
Core
ctype
curl
date
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
json
libxml
mcrypt
molten
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
redis
Reflection
session
sockets
SPL
sqlite3
standard
tokenizer
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

PHP执行还报错405 Method Not Allowed
# php -v
405 Method Not AllowedPHP 7.0.33 (cli) (built: Jul 30 2019 11:48:07) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies

将 zipkin 的 java 服务 kill 掉就正常了
#php -v
PHP 7.0.33 (cli) (built: Jul 30 2019 11:48:07) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions