LoginSignup
5
1

More than 3 years have passed since last update.

php公式dockerイメージで使えるphp拡張を調べる

Posted at

はじめに

  • phpの公式dockerイメージではdocker-php-ext-configure, docker-php-ext-enable, docker-php-ext-installでphp拡張を管理できる
  • dockerイメージの/usr/src/php.tar.xzにphp拡張のソースコードが予め含まれており、docker-php-ext-*でphp拡張を追加で有効にしたり、コンパイルオプションを調整して再ビルドしたりできる仕組みになっている
  • 扱えるのは事前にソースコードが用意されている分のみ

docker-php-ext-*で扱えるphp拡張を調べる

docker-php-ext-installのhelpを見ればわかる。

$ docker run --rm -it php:7.3-cli-alpine docker-php-ext-install
usage: /usr/local/bin/docker-php-ext-install [-jN] [--ini-name file.ini] ext-name [ext-name ...]
   ie: /usr/local/bin/docker-php-ext-install gd mysqli
       /usr/local/bin/docker-php-ext-install pdo pdo_mysql
       /usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop

if custom ./configure arguments are necessary, see docker-php-ext-configure

Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip

Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.

Possible values for ext-name:

以降に使えるphp拡張名が列挙されている。

php:7.3のイメージでは以下のようになっている。

bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
interbase
intl
json
ldap
mbstring
mysqli
oci8
odbc
opcache
pcntl
pdo
pdo_dblib
pdo_firebird
pdo_mysql
pdo_oci
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
phar
posix
pspell
readline
recode
reflection
session
shmop
simplexml
snmp
soap
sockets
sodium
spl
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zend_test
zip

ここにないものはpickleで入れる。
https://github.com/FriendsOfPhp/pickle

5
1
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
5
1