Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 23f2ed3

Browse files
authored
Merge pull request #34 from heyanlong/master
docs
2 parents 8ed6dd9 + 40b3c91 commit 23f2ed3

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

docs/install-agent.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,50 @@ When building directly from Git sources or after custom modifications you might
22
* libuuid
33
* gcc 4.9+
44
* pkg-config
5-
* grpc
6-
* protoc
5+
* grpc latest version
6+
* protoc latest version
77
* php 7+
8+
* SkyWalking Collector
89

910

10-
# Build
11+
# Install SkyWalking PHP Agent
12+
13+
You can run the following command to install the SkyWalking PHP Agent in your computer.
1114

12-
1. build php extension
1315
```shell
16+
// install php extension
1417
git clone --recurse-submodules https://github.com/SkywalkingContrib/skywalking-php-sdk.git
18+
cd skywalking-php-sdk
1519
phpize && ./configure && make && make install
16-
```
1720

18-
2. build report_client
19-
```shell
21+
// install report_client
2022
cd src/report
2123
make
24+
cp report_client /usr/bin
2225
```
2326

24-
# Config
25-
php.ini example
27+
# How to use
28+
29+
php.ini
30+
2631
```shell
32+
; Loading extensions in PHP
2733
extension=skywalking.so
34+
; enable skywalking
35+
skywalking.enable = 1
36+
; Set skyWalking collector version
2837
skywalking.version = 5
29-
skywalking.app_code = app_code
38+
; Set app code e.g. MyProjectName
39+
skywalking.app_code = MyProjectName
40+
; Set skyWalking collector grpc address
3041
skywalking.grpc = 127.0.0.1:11800
42+
; Set log path
43+
skywalking.log_path = /tmp
3144
```
3245

33-
# Run
34-
restart and run report_client
46+
Run `report_client` to send PHP generated log information to `SkyWalking collector`
3547
```shell
36-
./report_client 120.0.0.1:11800 /tmp
48+
// report_client [collector grpc address] [log path]
49+
// e.g.
50+
report_client 120.0.0.1:11800 /tmp
3751
```

skywalking.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ static void module_init() {
768768
/* {{{ PHP_MINIT_FUNCTION
769769
*/
770770
PHP_MINIT_FUNCTION (skywalking) {
771-
// ZEND_INIT_MODULE_GLOBALS(skywalking, php_skywalking_init_globals, NULL);
771+
ZEND_INIT_MODULE_GLOBALS(skywalking, php_skywalking_init_globals, NULL);
772772
//data_register_hashtable();
773773
REGISTER_INI_ENTRIES();
774774
/* If you have INI entries, uncomment these lines
@@ -860,12 +860,14 @@ PHP_MINFO_FUNCTION(skywalking)
860860
{
861861

862862
php_info_print_table_start();
863-
php_info_print_table_header(2, "skywalking support", "enabled");
863+
if (sky_close) {
864+
php_info_print_table_header(2, "skywalking Support", "disabled (register fail)");
865+
} else {
866+
php_info_print_table_header(2, "skywalking Support", "enabled");
867+
}
864868
php_info_print_table_end();
865869

866-
/* Remove comments if you have entries in php.ini
867870
DISPLAY_INI_ENTRIES();
868-
*/
869871
}
870872
/* }}} */
871873

0 commit comments

Comments
 (0)