LoginSignup
0
0

More than 3 years have passed since last update.

PHP+xmlrpcのDockerfile

Last updated at Posted at 2019-09-29

Dockerfile, compose

ubuntu版

Dockerfile
FROM php:7.3-cli
RUN apt-get update 
RUN apt-get install libxml2 libxml2-dev -y
RUN docker-php-ext-install xmlrpc

alpine版

Dockerfile
FROM php:7.3-alpine
RUN apk add libxml2 libxml2-dev
RUN docker-php-ext-install xmlrpc
RUN apk add vim

docker-compose.yaml

version: '2.1'

services:
  php7.3-xmlrpc:
    image: php7.3-xmlrpc
    build: .
    container_name: php7.3-xmlrpc
    tty: true

実装

xmlrpcのサンプルコード

sample.php
<?php
$a = xmlrpc_encode(['abc'=>123]);
$b = xmlrpc_decode($a);
var_dump($b);
> php sample.php

array(1) {
  ["abc"]=>
  int(123)
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0