This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +33
-17
lines changed Expand file tree Collapse file tree 2 files changed +33
-17
lines changed Original file line number Diff line number Diff line change @@ -2,36 +2,50 @@ When building directly from Git sources or after custom modifications you might
2
2
* libuuid
3
3
* gcc 4.9+
4
4
* pkg-config
5
- * grpc
6
- * protoc
5
+ * grpc latest version
6
+ * protoc latest version
7
7
* php 7+
8
+ * SkyWalking Collector
8
9
9
10
10
- # Build
11
+ # Install SkyWalking PHP Agent
12
+
13
+ You can run the following command to install the SkyWalking PHP Agent in your computer.
11
14
12
- 1 . build php extension
13
15
``` shell
16
+ // install php extension
14
17
git clone --recurse-submodules https://github.com/SkywalkingContrib/skywalking-php-sdk.git
18
+ cd skywalking-php-sdk
15
19
phpize && ./configure && make && make install
16
- ```
17
20
18
- 2 . build report_client
19
- ``` shell
21
+ // install report_client
20
22
cd src/report
21
23
make
24
+ cp report_client /usr/bin
22
25
```
23
26
24
- # Config
25
- php.ini example
27
+ # How to use
28
+
29
+ php.ini
30
+
26
31
``` shell
32
+ ; Loading extensions in PHP
27
33
extension=skywalking.so
34
+ ; enable skywalking
35
+ skywalking.enable = 1
36
+ ; Set skyWalking collector version
28
37
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
30
41
skywalking.grpc = 127.0.0.1:11800
42
+ ; Set log path
43
+ skywalking.log_path = /tmp
31
44
```
32
45
33
- # Run
34
- restart and run report_client
46
+ Run ` report_client ` to send PHP generated log information to ` SkyWalking collector `
35
47
``` 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
37
51
```
Original file line number Diff line number Diff line change @@ -768,7 +768,7 @@ static void module_init() {
768
768
/* {{{ PHP_MINIT_FUNCTION
769
769
*/
770
770
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 );
772
772
//data_register_hashtable();
773
773
REGISTER_INI_ENTRIES ();
774
774
/* If you have INI entries, uncomment these lines
@@ -860,12 +860,14 @@ PHP_MINFO_FUNCTION(skywalking)
860
860
{
861
861
862
862
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
+ }
864
868
php_info_print_table_end ();
865
869
866
- /* Remove comments if you have entries in php.ini
867
870
DISPLAY_INI_ENTRIES ();
868
- */
869
871
}
870
872
/* }}} */
871
873
You can’t perform that action at this time.
0 commit comments