提交 40b3c916 编写于 作者: H heyanlong

docs

上级 7d94f804
......@@ -2,36 +2,50 @@ When building directly from Git sources or after custom modifications you might
* libuuid
* gcc 4.9+
* pkg-config
* grpc
* protoc
* grpc latest version
* protoc latest version
* php 7+
* SkyWalking Collector
# Build
# Install SkyWalking PHP Agent
You can run the following command to install the SkyWalking PHP Agent in your computer.
1. build php extension
```shell
// install php extension
git clone --recurse-submodules https://github.com/SkywalkingContrib/skywalking-php-sdk.git
cd skywalking-php-sdk
phpize && ./configure && make && make install
```
2. build report_client
```shell
// install report_client
cd src/report
make
cp report_client /usr/bin
```
# Config
php.ini example
# How to use
php.ini
```shell
; Loading extensions in PHP
extension=skywalking.so
; enable skywalking
skywalking.enable = 1
; Set skyWalking collector version
skywalking.version = 5
skywalking.app_code = app_code
; Set app code e.g. MyProjectName
skywalking.app_code = MyProjectName
; Set skyWalking collector grpc address
skywalking.grpc = 127.0.0.1:11800
; Set log path
skywalking.log_path = /tmp
```
# Run
restart and run report_client
Run `report_client` to send PHP generated log information to `SkyWalking collector`
```shell
./report_client 120.0.0.1:11800 /tmp
// report_client [collector grpc address] [log path]
// e.g.
report_client 120.0.0.1:11800 /tmp
```
\ No newline at end of file
......@@ -768,7 +768,7 @@ static void module_init() {
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION (skywalking) {
// ZEND_INIT_MODULE_GLOBALS(skywalking, php_skywalking_init_globals, NULL);
ZEND_INIT_MODULE_GLOBALS(skywalking, php_skywalking_init_globals, NULL);
//data_register_hashtable();
REGISTER_INI_ENTRIES();
/* If you have INI entries, uncomment these lines
......@@ -860,12 +860,14 @@ PHP_MINFO_FUNCTION(skywalking)
{
php_info_print_table_start();
php_info_print_table_header(2, "skywalking support", "enabled");
if (sky_close) {
php_info_print_table_header(2, "skywalking Support", "disabled (register fail)");
} else {
php_info_print_table_header(2, "skywalking Support", "enabled");
}
php_info_print_table_end();
/* Remove comments if you have entries in php.ini
DISPLAY_INI_ENTRIES();
*/
}
/* }}} */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册