未验证 提交 46927dc8 编写于 作者: 何延龙 提交者: GitHub

Merge pull request #193 from digitalist-se/master

Just some suggestion to maybe improve some documentation
# Install SkyWalking PHP Agent
## Requirements
When building directly from Git sources or after custom modifications you might also need: When building directly from Git sources or after custom modifications you might also need:
* php 7+ * php 7+
* golang 1.13 * golang 1.13
* SkyWalking Collector * SkyWalking Collector
## PHP extension + Agent
The collect data from your instance you need both the PHP extension, and the agent.
No pre built binaries or PHP extension are availble at the moment, so you need to
build them from source.
# Install SkyWalking PHP Agent You can run the following commands to install the SkyWalking PHP Agent.
You can run the following command to install the SkyWalking PHP Agent in your computer.
## Install PHP Extension ## Install PHP Extension
```shell script ```shell script
...@@ -15,11 +20,10 @@ cd SkyAPM-php-sdk ...@@ -15,11 +20,10 @@ cd SkyAPM-php-sdk
phpize && ./configure && make && make install phpize && ./configure && make && make install
``` ```
## Install sky-php-agent (download or build) ## Install sky-php-agent
### Download sky-php-agent
Go to [release](https://github.com/SkyAPM/SkyAPM-php-sdk/releases) page to download the sky-php-agent required by your platform. Currently there are Linux (amd64, arm64) and Mac versions.
### Build ### Build
For installing the sky-php-agent, you first need to build it:
```shell script ```shell script
cd SkyAPM-php-sdk cd SkyAPM-php-sdk
go build -o sky-php-agent agent/cmd/main.go go build -o sky-php-agent agent/cmd/main.go
...@@ -53,3 +57,23 @@ sky-php-agent --grpc 127.0.0.1:11800 ...@@ -53,3 +57,23 @@ sky-php-agent --grpc 127.0.0.1:11800
``` ```
### ⚠️⚠️⚠️ Warning *Make sure PHP has read and write permissions on the socks file* ### ⚠️⚠️⚠️ Warning *Make sure PHP has read and write permissions on the socks file*
## Dockerfile
### Multi stage build example (starting point)
```bash
FROM golang:1.13 AS builder
ARG SKY_AGENT_VERSION=3.2.6
WORKDIR /go/src/app
RUN wget https://github.com/SkyAPM/SkyAPM-php-sdk/archive/${SKY_AGENT_VERSION}.tar.gz; \
tar xvf ${SKY_AGENT_VERSION}.tar.gz
RUN mv SkyAPM-php-sdk-${SKY_AGENT_VERSION} build
RUN cd build; \
GOOS=linux GOARCH=amd64 go build -o sky-php-agent-linux-x64 ./agent/cmd/main.go
FROM php:7.2.28-fpm-alpine3.11
# Copy from builder
COPY --from=builder /go/src/app/build/sky-php-agent-linux-x64 /usr/local/bin/sky-php-agent
RUN apk update && apk upgrade && apk add --no-cache autoconf libc6-compat libcurl curl-dev icu-dev & \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册