-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp.html
135 lines (121 loc) · 40 KB
/
php.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>PHP 扩展列表 | Docker LNMP Docs</title>
<meta name="generator" content="VuePress 1.7.1">
<meta name="description" content="">
<link rel="preload" href="/assets/css/0.styles.4bdbd8d9.css" as="style"><link rel="preload" href="/assets/js/app.209f2259.js" as="script"><link rel="preload" href="/assets/js/2.8af6cdaa.js" as="script"><link rel="preload" href="/assets/js/74.2cafcc32.js" as="script"><link rel="prefetch" href="/assets/js/10.be6825a7.js"><link rel="prefetch" href="/assets/js/100.03d20cb7.js"><link rel="prefetch" href="/assets/js/101.e786fe82.js"><link rel="prefetch" href="/assets/js/102.6c9d2de9.js"><link rel="prefetch" href="/assets/js/103.93d73ab5.js"><link rel="prefetch" href="/assets/js/104.9e50d9a7.js"><link rel="prefetch" href="/assets/js/105.f3f9432d.js"><link rel="prefetch" href="/assets/js/11.5ace5492.js"><link rel="prefetch" href="/assets/js/12.755ab736.js"><link rel="prefetch" href="/assets/js/13.3f1cae5e.js"><link rel="prefetch" href="/assets/js/14.77b9cd63.js"><link rel="prefetch" href="/assets/js/15.e1d177bf.js"><link rel="prefetch" href="/assets/js/16.dfd1de0f.js"><link rel="prefetch" href="/assets/js/17.1b359d8a.js"><link rel="prefetch" href="/assets/js/18.9269c7d7.js"><link rel="prefetch" href="/assets/js/19.781915cc.js"><link rel="prefetch" href="/assets/js/20.21128e97.js"><link rel="prefetch" href="/assets/js/21.dc763957.js"><link rel="prefetch" href="/assets/js/22.0626debe.js"><link rel="prefetch" href="/assets/js/23.a089e602.js"><link rel="prefetch" href="/assets/js/24.eb210250.js"><link rel="prefetch" href="/assets/js/25.9ccc7a03.js"><link rel="prefetch" href="/assets/js/26.88883549.js"><link rel="prefetch" href="/assets/js/27.e060a936.js"><link rel="prefetch" href="/assets/js/28.a219e9bf.js"><link rel="prefetch" href="/assets/js/29.4f674c07.js"><link rel="prefetch" href="/assets/js/3.b55cf771.js"><link rel="prefetch" href="/assets/js/30.2bb6ea0b.js"><link rel="prefetch" href="/assets/js/31.54b20cf7.js"><link rel="prefetch" href="/assets/js/32.4c3406bc.js"><link rel="prefetch" href="/assets/js/33.d54cec12.js"><link rel="prefetch" href="/assets/js/34.3f5de6f2.js"><link rel="prefetch" href="/assets/js/35.beff2e39.js"><link rel="prefetch" href="/assets/js/36.f9a34636.js"><link rel="prefetch" href="/assets/js/37.3dc04856.js"><link rel="prefetch" href="/assets/js/38.6d855a6e.js"><link rel="prefetch" href="/assets/js/39.fc73f21d.js"><link rel="prefetch" href="/assets/js/4.6d0e0c17.js"><link rel="prefetch" href="/assets/js/40.af31e3da.js"><link rel="prefetch" href="/assets/js/41.671019c4.js"><link rel="prefetch" href="/assets/js/42.2294d29b.js"><link rel="prefetch" href="/assets/js/43.db6a01ac.js"><link rel="prefetch" href="/assets/js/44.dd24a4b9.js"><link rel="prefetch" href="/assets/js/45.49453970.js"><link rel="prefetch" href="/assets/js/46.fd24200c.js"><link rel="prefetch" href="/assets/js/47.1949af45.js"><link rel="prefetch" href="/assets/js/48.79ae6536.js"><link rel="prefetch" href="/assets/js/49.fcde6b7f.js"><link rel="prefetch" href="/assets/js/5.0b207204.js"><link rel="prefetch" href="/assets/js/50.3b4d4418.js"><link rel="prefetch" href="/assets/js/51.edfa61cd.js"><link rel="prefetch" href="/assets/js/52.1b769c3f.js"><link rel="prefetch" href="/assets/js/53.dd0bc9d8.js"><link rel="prefetch" href="/assets/js/54.39176a80.js"><link rel="prefetch" href="/assets/js/55.573b9c31.js"><link rel="prefetch" href="/assets/js/56.b6a02619.js"><link rel="prefetch" href="/assets/js/57.f8ed8637.js"><link rel="prefetch" href="/assets/js/58.3c7e3293.js"><link rel="prefetch" href="/assets/js/59.a1bc011e.js"><link rel="prefetch" href="/assets/js/6.aa1ab838.js"><link rel="prefetch" href="/assets/js/60.3d64fb37.js"><link rel="prefetch" href="/assets/js/61.1d72bf34.js"><link rel="prefetch" href="/assets/js/62.ff909897.js"><link rel="prefetch" href="/assets/js/63.65e0c100.js"><link rel="prefetch" href="/assets/js/64.5b81f0b9.js"><link rel="prefetch" href="/assets/js/65.7b5fd5e7.js"><link rel="prefetch" href="/assets/js/66.10a94919.js"><link rel="prefetch" href="/assets/js/67.b4203de5.js"><link rel="prefetch" href="/assets/js/68.3334bcd9.js"><link rel="prefetch" href="/assets/js/69.076289e0.js"><link rel="prefetch" href="/assets/js/7.7f24f1db.js"><link rel="prefetch" href="/assets/js/70.d3dd1b6a.js"><link rel="prefetch" href="/assets/js/71.a63a7128.js"><link rel="prefetch" href="/assets/js/72.1ce4ef4e.js"><link rel="prefetch" href="/assets/js/73.1b194ce3.js"><link rel="prefetch" href="/assets/js/75.811dfed4.js"><link rel="prefetch" href="/assets/js/76.9ecc5669.js"><link rel="prefetch" href="/assets/js/77.2d332363.js"><link rel="prefetch" href="/assets/js/78.1abbc712.js"><link rel="prefetch" href="/assets/js/79.7f694bba.js"><link rel="prefetch" href="/assets/js/8.dd0082e7.js"><link rel="prefetch" href="/assets/js/80.0c834a8c.js"><link rel="prefetch" href="/assets/js/81.e68b030b.js"><link rel="prefetch" href="/assets/js/82.ee15fd72.js"><link rel="prefetch" href="/assets/js/83.6630a350.js"><link rel="prefetch" href="/assets/js/84.c80210c2.js"><link rel="prefetch" href="/assets/js/85.84af9d91.js"><link rel="prefetch" href="/assets/js/86.c8eed3fa.js"><link rel="prefetch" href="/assets/js/87.158128c8.js"><link rel="prefetch" href="/assets/js/88.2d5efaec.js"><link rel="prefetch" href="/assets/js/89.e355abb7.js"><link rel="prefetch" href="/assets/js/9.d899d975.js"><link rel="prefetch" href="/assets/js/90.15e01064.js"><link rel="prefetch" href="/assets/js/91.a2f1ddf4.js"><link rel="prefetch" href="/assets/js/92.a40c425c.js"><link rel="prefetch" href="/assets/js/93.34101b59.js"><link rel="prefetch" href="/assets/js/94.2f5ec23e.js"><link rel="prefetch" href="/assets/js/95.7a3dabc9.js"><link rel="prefetch" href="/assets/js/96.2ecdb225.js"><link rel="prefetch" href="/assets/js/97.864e2d0f.js"><link rel="prefetch" href="/assets/js/98.3dad48c6.js"><link rel="prefetch" href="/assets/js/99.97e12689.js">
<link rel="stylesheet" href="/assets/css/0.styles.4bdbd8d9.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">Docker LNMP Docs</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">
使用指引
</a></div><div class="nav-item"><a href="/ee/" class="nav-link">
商业版
</a></div><div class="nav-item"><a href="https://github.com/khs1994-docker/lnmp" target="_blank" rel="noopener noreferrer" class="nav-link external">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://zan.khs1994.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
捐赠
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=3a5255852d5db99dcd5da4c72f05df61&from=console" target="_blank" rel="noopener noreferrer" class="nav-link external">
腾讯云服务器限时秒杀
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">
使用指引
</a></div><div class="nav-item"><a href="/ee/" class="nav-link">
商业版
</a></div><div class="nav-item"><a href="https://github.com/khs1994-docker/lnmp" target="_blank" rel="noopener noreferrer" class="nav-link external">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://zan.khs1994.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
捐赠
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=3a5255852d5db99dcd5da4c72f05df61&from=console" target="_blank" rel="noopener noreferrer" class="nav-link external">
腾讯云服务器限时秒杀
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Introduction</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/" aria-current="page" class="sidebar-link">khs1994-docker/lnmp 支持文档</a></li><li><a href="/why.html" class="sidebar-link">项目初衷</a></li><li><a href="/docker.html" class="sidebar-link">安装 Docker</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>安装</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/install/linux.html" class="sidebar-link">Linux/macOS 上安装</a></li><li><a href="/install/windows.html" class="sidebar-link">Windows 上安装</a></li><li><a href="/mysql.html" class="sidebar-link">MySQL</a></li><li><a href="/update.html" class="sidebar-link">更新</a></li><li><a href="/cli.html" class="sidebar-link">命令行工具</a></li><li><a href="/init.html" class="sidebar-link">初始化过程</a></li><li><a href="/path.html" class="sidebar-link">本地路径和 Docker 内路径对应关系</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>开发环境</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/development.html" class="sidebar-link">开发环境</a></li><li><a href="/phpmyadmin.html" class="sidebar-link">phpMyAdmin</a></li><li><a href="/custom.html" class="sidebar-link">个性化方案</a></li><li><a href="/lrew.html" class="sidebar-link">lrew</a></li><li><a href="/backup.html" class="sidebar-link">备份恢复</a></li><li><a href="/cleanup.html" class="sidebar-link">清理</a></li><li><a href="/config.html" class="sidebar-link">软件配置</a></li><li><a href="/port.html" class="sidebar-link">服务端口开放</a></li><li><a href="/command.html" class="sidebar-link">PHPer 常用命令容器化</a></li><li><a href="/lpm.html" class="sidebar-link">包管理工具 lpm</a></li><li><a href="/compose.html" class="sidebar-link">Docker Compose</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>nginx</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/nginx/" class="sidebar-link">NGINX</a></li><li><a href="/nginx/config.html" class="sidebar-link">一键生成 nginx 配置</a></li><li><a href="/nginx/issue-ssl.html" class="sidebar-link">申请 SSL 证书</a></li><li><a href="/nginx/https.html" class="sidebar-link">NGINX HTTPS 配置文件</a></li><li><a href="/nginx/unit.html" class="sidebar-link">NGINX Unit</a></li><li><a href="/nginx/arg.html" class="sidebar-link">Nginx 内置变量</a></li><li><a href="/nginx/http3.html" class="sidebar-link">http3</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>PHP</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/php.html" aria-current="page" class="active sidebar-link">PHP 扩展列表</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/php.html#pecl-扩展" class="sidebar-link">pecl 扩展</a></li><li class="sidebar-sub-header"><a href="/php.html#自行增加扩展" class="sidebar-link">自行增加扩展</a></li><li class="sidebar-sub-header"><a href="/php.html#官方扩展列表" class="sidebar-link">官方扩展列表</a></li><li class="sidebar-sub-header"><a href="/php.html#session-redis-驱动" class="sidebar-link">Session Redis 驱动</a></li><li class="sidebar-sub-header"><a href="/php.html#more-information" class="sidebar-link">More Information</a></li></ul></li><li><a href="/xdebug.html" class="sidebar-link">Xdebug in Docker + PhpStorm</a></li><li><a href="/laravel.html" class="sidebar-link">Laravel 最佳实践</a></li><li><a href="/composer.html" class="sidebar-link">Composer 最佳实践</a></li><li><a href="/phpunit.html" class="sidebar-link">PHPUnit in Docker + PHPStorm 最佳实践</a></li><li><a href="/xhprof.html" class="sidebar-link">XHProf</a></li><li><a href="/swoole.html" class="sidebar-link">Swoole</a></li><li><a href="/composer/" class="sidebar-link">Composer</a></li><li><a href="/composer/satis.html" class="sidebar-link">Satis</a></li><li><a href="/symfony.html" class="sidebar-link">Symfony</a></li><li><a href="/php_eol.html" class="sidebar-link">使用 EOL 的 PHP 版本</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>生产环境</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/production.html" class="sidebar-link">配置</a></li><li><a href="/swarm/" class="sidebar-link">Docker Swarm</a></li><li><a href="/kubernetes/" class="sidebar-link">在 Kubernetes 集群部署 LNMP</a></li><li><a href="/kubernetes/docker-desktop.html" class="sidebar-link">K8s on Docker Desktop</a></li><li><a href="/registry.html" class="sidebar-link">Docker Registry</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>计划任务</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/crontab.html" class="sidebar-link">Crontab 计划任务</a></li><li><a href="/supervisord.html" class="sidebar-link">Supervisord</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>镜像构建</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/manifest.html" class="sidebar-link">构建支持多种架构的 Docker 镜像</a></li><li><a href="/buildx.html" class="sidebar-link">docker buildx</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>数据卷 Volumes</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/volumes/nfs.html" class="sidebar-link">NFS Volume(NFSv4)</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>集群</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/clusterkit/" class="sidebar-link">ClusterKit</a></li><li><a href="/clusterkit/memcached.html" class="sidebar-link">Memcached</a></li><li><a href="/clusterkit/mysql.html" class="sidebar-link">MySQL 复制</a></li><li><a href="/clusterkit/redis_cluster.html" class="sidebar-link">Redis 集群版 (redis-cli --cluster)</a></li><li><a href="/clusterkit/redis_replication.html" class="sidebar-link">Redis 主从版 (M-S) 复制模式 replication</a></li><li><a href="/clusterkit/redis_sentinel.html" class="sidebar-link">Redis 哨兵版 Sentinel</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>参考</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/dockerd.html" class="sidebar-link">dockerd</a></li><li><a href="/dockerfiles.html" class="sidebar-link">Dockerfile 注意事项</a></li><li><a href="/systemd.html" class="sidebar-link">systemd</a></li><li><a href="/journalctl.html" class="sidebar-link">systemd 日志管理</a></li><li><a href="/git.html" class="sidebar-link">Git Tips</a></li><li><a href="/gpg.html" class="sidebar-link">Git GPG</a></li><li><a href="/network.html" class="sidebar-link">国内网络问题</a></li><li><a href="/mirror.html" class="sidebar-link">Docker 常用镜像站点</a></li><li><a href="/windows/container.html" class="sidebar-link">Windows Container</a></li><li><a href="/arm.html" class="sidebar-link">ARM 架构</a></li><li><a href="/ab.html" class="sidebar-link">ab command</a></li><li><a href="/minio.html" class="sidebar-link">Minio</a></li><li><a href="/windows/wsl2.html" class="sidebar-link">WSL2</a></li><li><a href="/powershell.html" class="sidebar-link">PowerShell</a></li><li><a href="/go.html" class="sidebar-link">Go</a></li><li><a href="/github.html" class="sidebar-link">GitHub</a></li><li><a href="/vscode.html" class="sidebar-link">VSCode</a></li><li><a href="/cgroupv2.html" class="sidebar-link">cGroupv2</a></li><li><a href="/iscsi.html" class="sidebar-link">ISCSI</a></li><li><a href="/mount.html" class="sidebar-link">文件挂载相关命令</a></li><li><a href="/cfssl.html" class="sidebar-link">CFSSL</a></li><li><a href="/ssh.html" class="sidebar-link">SSH</a></li><li><a href="/encrypt.html" class="sidebar-link">加解密文件</a></li><li><a href="/coding/ci.html" class="sidebar-link">【玩转腾讯云】在 CODING DevOps 持续集成中使用 Buildx 构建 Docker 镜像</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="php-扩展列表"><a href="#php-扩展列表" class="header-anchor">#</a> PHP 扩展列表</h1> <blockquote><p>更多扩展请通过 <code>$ php -m</code> 查看</p></blockquote> <p>如果你需要增加其他扩展,请到这里 <a href="https://github.com/khs1994-docker/lnmp/issues/63" target="_blank" rel="noopener noreferrer">issues<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> 反馈。</p> <h2 id="pecl-扩展"><a href="#pecl-扩展" class="header-anchor">#</a> pecl 扩展</h2> <ul><li><a href="http://pecl.php.net/package/igbinary" target="_blank" rel="noopener noreferrer">igbinary<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://pecl.php.net/package/memcached" target="_blank" rel="noopener noreferrer">memcached ( memcache 太旧)<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://pecl.php.net/package/mongodb" target="_blank" rel="noopener noreferrer">mongodb ( mongo 已经废弃)<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://pecl.php.net/package/redis" target="_blank" rel="noopener noreferrer">redis<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="http://pecl.php.net/package/swoole" target="_blank" rel="noopener noreferrer">Swoole<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li> <li><a href="https://pecl.php.net/package/xdebug" target="_blank" rel="noopener noreferrer">xdebug (生产环境不启用)<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul> <p><strong>核心扩展</strong></p> <ul><li><strong>mysql</strong> 7.0 移除</li> <li><strong>mcrypt</strong> 7.2 移除</li> <li><strong>interbase</strong> 7.4 移除</li> <li><strong>wddx</strong> 7.4 移除</li> <li><strong>recode</strong> 7.4 移除</li> <li><strong>xmlrpc</strong> 8.0 移除</li></ul> <h2 id="自行增加扩展"><a href="#自行增加扩展" class="header-anchor">#</a> 自行增加扩展</h2> <p>以下两种方式任选一种,然后按照 <a href="/custom.html">自定义</a> 替换为自己的镜像,具体实例可以 <a href="https://github.com/khs1994-docker/php/tree/master/custom" target="_blank" rel="noopener noreferrer">参考这里<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>:</p> <p><strong>1. 基于 <code>khs1994/php:X.Y.Z-TYPE-alpine</code> 重新构建镜像</strong></p> <div class="language-docker extra-class"><pre class="language-docker"><code><span class="token keyword">ARG</span> PHP_VERSION=7.3.17
<span class="token keyword">ARG</span> USERNAME=khs1994
<span class="token keyword">FROM</span> $<span class="token punctuation">{</span>USERNAME<span class="token punctuation">}</span>/php<span class="token punctuation">:</span>$<span class="token punctuation">{</span>PHP_VERSION<span class="token punctuation">}</span><span class="token punctuation">-</span>fpm<span class="token punctuation">-</span>alpine
<span class="token comment"># 扩展源码在 PHP 源码</span>
<span class="token keyword">ENV</span> PHP_CORE_EXT \
xsl
<span class="token comment"># pecl 扩展</span>
<span class="token comment"># 如果 PHP 版本已经 EOL,建议加上版本号,因为新的扩展可能不再兼容旧的 PHP 版本</span>
<span class="token keyword">ENV</span> PHP_PECL_EXT \
xxx \
xxx2<span class="token punctuation">-</span>beta \
xxx3<span class="token punctuation">-</span>x.y.z
<span class="token keyword">ENV</span> EXT_BUILD_DEP \
xxx<span class="token punctuation">-</span>dev
<span class="token keyword">ENV</span> EXT_RUN_DEP \
xxx
<span class="token keyword">ARG</span> ALPINE_URL=dl<span class="token punctuation">-</span>cdn.alpinelinux.org
<span class="token keyword">RUN</span> set <span class="token punctuation">-</span>x \
&& sed <span class="token punctuation">-</span>i <span class="token string">"s/dl-cdn.alpinelinux.org/${ALPINE_URL}/g"</span> /etc/apk/repositories \
<span class="token comment"># 安装构建依赖,构建之后可以删除</span>
&& apk add <span class="token punctuation">-</span><span class="token punctuation">-</span>no<span class="token punctuation">-</span>cache <span class="token punctuation">-</span><span class="token punctuation">-</span>virtual .pecl_build_deps $EXT_BUILD_DEP $PHPIZE_DEPS \
<span class="token comment"># 安装运行依赖,不可以删除</span>
&& apk add <span class="token punctuation">-</span><span class="token punctuation">-</span>no<span class="token punctuation">-</span>cache $EXT_RUN_DEP \
<span class="token comment"># !请自行编辑以下内容</span>
<span class="token comment"># 解压 PHP 源码,仅当扩展源码在 PHP 源码中时需要</span>
<span class="token comment"># && docker-php-source extract \</span>
<span class="token comment">#</span>
<span class="token comment"># 5.6 | 7.0</span>
<span class="token comment">#</span>
<span class="token comment"># && docker-php-ext-configure XXX --XXX \</span>
&& docker<span class="token punctuation">-</span>php<span class="token punctuation">-</span>ext<span class="token punctuation">-</span>install $PHP_CORE_EXT \
&& docker<span class="token punctuation">-</span>php<span class="token punctuation">-</span>ext<span class="token punctuation">-</span>enable $PHP_CORE_EXT \
&& for extension in $<span class="token punctuation">{</span>PHP_PECL_EXT<span class="token punctuation">}</span>;do \
ext_real_name=$(echo $<span class="token punctuation">{</span>extension<span class="token punctuation">}</span> <span class="token punctuation">|</span> cut <span class="token punctuation">-</span>d <span class="token string">'-'</span> <span class="token punctuation">-</span>f 1) \
&& pecl install $extension \
&& docker<span class="token punctuation">-</span>php<span class="token punctuation">-</span>ext<span class="token punctuation">-</span>enable $ext_real_name <span class="token punctuation">|</span><span class="token punctuation">|</span> echo <span class="token string">"pecl ${extension} install error"</span> \
&& rm <span class="token punctuation">-</span>rf /usr/local/lib/php/doc/$ext_real_name \
&& rm <span class="token punctuation">-</span>rf /usr/local/lib/php/test/$ext_real_name \
&& rm <span class="token punctuation">-</span>rf /usr/local/include/php/ext/$ext_real_name \
&& strip <span class="token punctuation">-</span><span class="token punctuation">-</span>strip<span class="token punctuation">-</span>all $(php<span class="token punctuation">-</span>config <span class="token punctuation">-</span><span class="token punctuation">-</span>extension<span class="token punctuation">-</span>dir)/$ext_real_name.so ; \
done \
<span class="token comment">#</span>
<span class="token comment"># 7.1 + 可以使用 pickle 安装 PHP 扩展</span>
<span class="token comment">#</span>
<span class="token comment"># && echo "--xxx" > /tmp/EXT_NAME.configure.options \</span>
&& pickle install $PHP_CORE_EXT $PHP_PECL_EXT <span class="token punctuation">-</span>n <span class="token punctuation">-</span><span class="token punctuation">-</span>defaults <span class="token punctuation">-</span><span class="token punctuation">-</span>strip <span class="token punctuation">-</span><span class="token punctuation">-</span>cleanup \
<span class="token comment"># !请自行编辑以上内容</span>
<span class="token comment"># 清理</span>
&& docker<span class="token punctuation">-</span>php<span class="token punctuation">-</span>source delete \
&& apk del <span class="token punctuation">-</span><span class="token punctuation">-</span>no<span class="token punctuation">-</span>network .pecl_build_deps \
&& rm <span class="token punctuation">-</span>rf /tmp/* \
&& rm <span class="token punctuation">-</span>rf /usr/local/lib/php/.registry/.channel.pecl.php.net/* \
<span class="token comment"># 验证</span>
&& php <span class="token punctuation">-</span>m \
&& ls <span class="token punctuation">-</span>la $(php<span class="token punctuation">-</span>config <span class="token punctuation">-</span><span class="token punctuation">-</span>extension<span class="token punctuation">-</span>dir)
<span class="token comment"># !请自行编辑以下内容</span>
<span class="token comment"># 默认不启用的扩展可以将配置文件改为不以 .ini 结尾的文件名</span>
<span class="token comment"># && mv /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \</span>
<span class="token comment"># /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini.default</span>
</code></pre></div><p><strong>2. 使用 Dockerfile 重头构建</strong></p> <ul><li>https://github.com/khs1994-docker/php</li></ul> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token comment"># 这里只列出基本参数,其他参数按需自行添加</span>
$ docker buildx build <span class="token punctuation">\</span>
--build-arg <span class="token assign-left variable">PHP_EXTENSION_EXTRA</span><span class="token operator">=</span><span class="token string">"xsl"</span> <span class="token punctuation">\</span>
--build-arg <span class="token assign-left variable">PECL_EXTENSION_EXTRA</span><span class="token operator">=</span><span class="token string">"imagick msgpack"</span> <span class="token punctuation">\</span>
--build-arg <span class="token assign-left variable">APK_EXTRA</span><span class="token operator">=</span><span class="token string">"libxslt imagemagick-libs musl"</span> <span class="token punctuation">\</span>
--build-arg <span class="token assign-left variable">APK_DEV_EXTRA</span><span class="token operator">=</span><span class="token string">"libxslt-dev imagemagick imagemagick-dev"</span> <span class="token punctuation">\</span>
--build-arg <span class="token assign-left variable">PHP_VERSION</span><span class="token operator">=</span><span class="token string">"X.Y.Z"</span> <span class="token punctuation">\</span>
--build-arg <span class="token assign-left variable">USERNAME</span><span class="token operator">=</span><span class="token variable">${USERNAME<span class="token operator">:?</span>USERNAME must set}</span> <span class="token punctuation">\</span>
--build-arg <span class="token assign-left variable">ALPINE_URL</span><span class="token operator">=</span><span class="token variable">${ALPINE_URL<span class="token operator">:-</span>dl-cdn.alpinelinux.org}</span> <span class="token punctuation">\</span>
--push <span class="token punctuation">\</span>
-t USERNAME/php:X.Y.Z-TYPE-alpine FOLDER
</code></pre></div><h2 id="官方扩展列表"><a href="#官方扩展列表" class="header-anchor">#</a> 官方扩展列表</h2> <div class="language-bash extra-class"><pre class="language-bash"><code>$ 进入 PHP 源码目录 ext 目录
$ docker run -it -d khs1994/php-fpm:7.2.4-alpine3.7
<span class="token comment"># 记住 container id ,并替换下边命令的 CONTAINER_ID</span>
$ <span class="token keyword">for</span> <span class="token for-or-select variable">ext</span> <span class="token keyword">in</span> <span class="token variable"><span class="token variable">`</span><span class="token function">ls</span><span class="token variable">`</span></span><span class="token punctuation">;</span> <span class="token keyword">do</span> <span class="token builtin class-name">echo</span> <span class="token string">'*'</span> <span class="token variable"><span class="token variable">$(</span> docker <span class="token builtin class-name">exec</span> -it CONTAINER_ID php -r "if<span class="token punctuation">(</span>extension_loaded<span class="token punctuation">(</span><span class="token string">'<span class="token variable">$ext</span>'</span><span class="token punctuation">)</span><span class="token variable">)</span></span><span class="token punctuation">{</span>echo <span class="token string">'[x] <span class="token variable">$ext</span>'</span><span class="token punctuation">;</span><span class="token punctuation">}</span>else<span class="token punctuation">{</span>echo <span class="token string">'[ ] <span class="token variable">$ext</span>'</span><span class="token punctuation">;</span><span class="token punctuation">}</span>" <span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token keyword">done</span>
$ docker <span class="token function">rm</span> -f CONTAINER_ID
</code></pre></div><ul><li>[x] bcmath</li> <li>[x] bz2</li> <li>[x] calendar</li> <li>[ ] com_dotnet</li> <li>[x] ctype</li> <li>[x] curl</li> <li>[x] date</li> <li>[ ] dba</li> <li>[x] dom</li> <li>[x] enchant</li> <li>[x] exif</li> <li>[ ] ext_skel.php</li> <li>[x] ffi</li> <li>[x] fileinfo</li> <li>[x] filter</li> <li>[x] ftp</li> <li>[x] gd</li> <li>[x] gettext</li> <li>[x] gmp</li> <li>[x] hash</li> <li>[x] iconv</li> <li>[x] imap</li> <li>[x] intl</li> <li>[x] json</li> <li>[x] ldap</li> <li>[x] libxml</li> <li>[x] mbstring</li> <li>[x] mysqli</li> <li>[x] mysqlnd</li> <li>[ ] oci8</li> <li>[ ] odbc</li> <li>[ ] opcache</li> <li>[x] openssl</li> <li>[x] pcntl</li> <li>[x] pcre</li> <li>[x] pdo</li> <li>[ ] pdo_dblib</li> <li>[ ] pdo_firebird</li> <li>[x] pdo_mysql</li> <li>[ ] pdo_oci</li> <li>[ ] pdo_odbc</li> <li>[x] pdo_pgsql</li> <li>[x] pdo_sqlite</li> <li>[x] pgsql</li> <li>[x] phar</li> <li>[x] posix</li> <li>[x] pspell</li> <li>[x] readline</li> <li>[x] reflection</li> <li>[x] session</li> <li>[x] shmop</li> <li>[x] simplexml</li> <li>[ ] skeleton</li> <li>[ ] snmp</li> <li>[x] soap</li> <li>[x] sockets</li> <li>[x] sodium</li> <li>[x] spl</li> <li>[x] sqlite3</li> <li>[x] standard</li> <li>[x] sysvmsg</li> <li>[x] sysvsem</li> <li>[x] sysvshm</li> <li>[x] tidy</li> <li>[x] tokenizer</li> <li>[x] xml</li> <li>[x] xmlreader</li> <li>[ ] xmlrpc</li> <li>[x] xmlwriter</li> <li>[x] xsl</li> <li>[ ] zend_test</li> <li>[x] zip</li> <li>[x] zlib</li></ul> <h2 id="session-redis-驱动"><a href="#session-redis-驱动" class="header-anchor">#</a> Session Redis 驱动</h2> <div class="language-ini extra-class"><pre class="language-ini"><code><span class="token constant">session.save_handler</span> <span class="token attr-value"><span class="token punctuation">=</span> redis</span>
<span class="token constant">session.save_path</span> <span class="token attr-value"><span class="token punctuation">=</span>"tcp://redis:6379?auth=redis密码"</span>
</code></pre></div><h2 id="more-information"><a href="#more-information" class="header-anchor">#</a> More Information</h2> <ul><li><a href="https://github.com/mongodb/mongo-php-driver" target="_blank" rel="noopener noreferrer">mongodb<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/khs1994-docker/lnmp/edit/master/docs/php.md" target="_blank" rel="noopener noreferrer">Edit this page</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
←
<a href="/nginx/http3.html" class="prev">
http3
</a></span> <span class="next"><a href="/xdebug.html">
Xdebug in Docker + PhpStorm
</a>
→
</span></p></div> </main></div><div class="global-ui"></div></div>
<script src="/assets/js/app.209f2259.js" defer></script><script src="/assets/js/2.8af6cdaa.js" defer></script><script src="/assets/js/74.2cafcc32.js" defer></script>
</body>
</html>