PHP模块一览及简要说明
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |
PHP 编译完成后,可以通过一个简单的函数 phpinfo() 查看关于 PHP 的所有信息。以下介绍的模块一览,皆全部来自于函数 phpinfo() 的输出信息。SAPI Modules
什么是 SAPI?
SAPI 即 Server API, Server Application Programming Interface。
用于 Apache 2 的模块,当安装的是 PHP 5 的时候,编译出来的文件名是 libphp5.so;当安装的是 PHP 7 的时候,编译出来的文件名是 libphp7.so。
libphp5.so 或 libphp7.so 通常被安装在 Apache 的安装目录下的 modules 目录。
编译的时候需指定参数 −−with-apxs2=FILE,比如 −−with-apxs2=/usr/local/apache/bin/apxs2、CGI / FastCGI
CGI,意为 Common Gateway Interface。
通常编译安装在 PHP 安装目录 bin 下,这个可执行文件名是 php-cgi。3、CLI
CLI,意为 Command Line。命令行模式。
通常编译安装在 PHP 安装目录 bin 下,这个可执行文件名是 php。
输入 php -h 显示其用法。4、Embed
默认不编译安装,除非指定编译参数 −−enable-embed
该模块允许在 C/C++ 语言中调用 PHP 提供的函数。5、FastCGI Process Manager
FastCGI Process Manager,也就是 FPM,PHP FastCGI 进程的管理器。6、litespeed
用于 LiteSpeed 的模块,默认不编译。
通过指定编译参数 −−with-litespeed 安装。 Build PHP as litespeed module7、phpdbg
从 PHP 5.6 开始,引入了 phpdbg,交互式调试器,用于 Debug PHP 程序,可以在不用修改代码,不影响性能的情况下控制 PHP 的运行环境。
通常编译安装在 PHP 安装目录 bin 下,这个可执行文件名是 phpdbg。
PHP 5.4 和 5.5 也可以单独安装该模块。
PHP Modules
PHP 源码自带的扩展模块,根据 PHP 版本的不同略有差别,大致为以下这么 71 个模块。
1、BC Math通过指定编译参数 −−enable-bcmath 安装。 Enable bc style precision math functions2、Bzip2
通过指定编译参数 −−with-bz2=DIR 安装。 Include BZip2 support
Debian/Ubuntu 需安装 libbz2-dev 依赖包。
Redhat/CentOS 需安装 bzip2-devel 依赖包。3、Calendar
通过指定编译参数 −−enable-calendar 安装。 Enable support for calendar conversion4、COM and .Net
Windows 专用扩展。COM 是指 Component Object Model,组件对象模型,是多项微软技术与框架的基础,包括OLE、OLE自动化、ActiveX、COM+、DCOM、Windows shell、DirectX、Windows Runtime。5、ctype
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-ctype6、cURL
通过指定编译参数 −−with-curl=DIR 安装。 Include cURL support
Debian/Ubuntu 需安装 libcurl4-gnutls-dev 依赖包。
Redhat/CentOS 需安装 curl-devel 依赖包。7、Date/Time Support(date)
日期和时间函数,默认编译安装,不可禁止。8、DBA
通过指定编译参数 −−enable-dba 安装。 Build DBA with bundled modules
该参数会默认自带 3 个参数,−−with-cdb,−−enable-inifile,inifile-flatfile,若要禁止,则需通过参数−−without-cdb=DIR,−−disable-inifile,−−disable-flatfile 实现。9、DB-LIB (MS SQL, Sybase)(pdo_dblib)
Windows 专用扩展。用于连接 SQL Server 和 Sybase 数据库的 PDO 驱动扩展。10、DOM
此扩展默认为启用,Document Object Model。编译时可通过下列选项禁用:−−disable-dom11、enchant
通过指定编译参数 −−with-enchant=DIR 安装。 Include enchant support. GNU Aspell version 1.1.3 or higher required.
一般需指定其目录,−−with-enchant=/usr
Debian/Ubuntu 需安装 libenchant-dev, libpspell-dev 依赖包。
Redhat/CentOS 需安装 enchant-devel, aspell-devel 依赖包。12、EXIF
通过指定编译参数 −−enable-exif 安装。 Enable EXIF (metadata from images) support13、fileinfo
此扩展默认为启用,fileinfo support。编译时可通过下列选项禁用:−−disable-fileinfo
注意:在内存比较小的机器上编译此扩展时可能会失败,因此内存加 SWAP 的容量小于 480MB 时就不要安装了。14、Filter
此扩展默认为启用,input filter support。编译时可通过下列选项禁用:−−disable-filter
另如果要给此扩展指定 PCRE 安装目录的话,则还有以下的编译参数。
−−with-pcre-dir FILTER: pcre install pix15、Firebird driver for PDO(pdo_firebird)
−−with-interbase=DIR Include Firebird support. DIR is the Firebird base install directory
−−with-pdo-firebird=DIR PDO: Firebird support. DIR is the Firebird base install directory16、FTP
通过指定编译参数 −−enable-ftp 安装。Enable FTP support
安装该扩展还有个参数 −−with-openssl-dir=DIR FTP: openssl install pix,可不指定,则使用系统自带 openssl 库。17、GD imaging(gd)
通过指定编译参数 −−with-gd=DIR 安装。Include GD support. DIR is the GD library base install directory BUNDLED
这是一个打包式的依赖,需要依赖如下安装包。
−−with-webp-dir=DIR(PHP 7.0, 7.1 only)
−−with-jpeg-dir=DIR
−−with-png-dir=DIR
−−with-zlib-dir=DIR
−−with-xpm-dir=DIR
−−with-freetype-dir=DIR
−−enable-gd-native-ttf
−−enable-gd-jis-convPHP5.4、PHP5.5、PHP5.6 则还有个
−−with-vpx-dir=DIRDebian/Ubuntu 需安装 libwebp-dev, libjpeg-dev, libpng-dev, libxpm-dev, libfreetype6-dev, libvpx-dev 依赖包。
Redhat/CentOS 需安装 libwebp-devel, libjpeg-devel, libpng-devel, libXpm-devel, freetype-devel, libvpx-devel 依赖包。18、GetText
通过指定编译参数 −−with-gettext=DIR 安装。Include GNU gettext support
Debian/Ubuntu 需安装 gettext 依赖包。
Redhat/CentOS 需安装 gettext, gettext-devel 依赖包。19、GMP
通过指定编译参数 −−with-gmp=DIR 安装。Include GNU MP support
Debian/Ubuntu 需安装 libgmp-dev 依赖包。
Redhat/CentOS 需安装 gmp-devel 依赖包。20、Hash
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-hash Disable hash support21、iconv
此扩展默认为启用,编译时可通过下列选项禁用:−−without-iconv=DIR Exclude iconv support22、IMAP
通过指定以下编译参数。
−−with-imap=DIR Include IMAP support. DIR is the c-client install pix
−−with-kerberos=DIR IMAP: Include Kerberos support. DIR is the Kerberos install pix
−−with-imap-ssl=DIR IMAP: Include SSL support. DIR is the OpenSSL install pix
编译此选项时,PHP 需指定 libc-client.a 所在目录。23、InterBase
−−with-interbase=DIR Include Firebird support. DIR is the Firebird base install directory24、Internationalization(intl)
通过指定编译参数 −−enable-intl 安装。 Enable internationalization support25、json
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-json Disable JavaScript Object Serialization support26、LDAP
−−with-ldap=DIR Include LDAP support
−−with-ldap-sasl=DIR LDAP: Include Cyrus SASL support
Debian/Ubuntu 需安装 libldap-2.4-2, libldap2-dev 依赖包。
Redhat/CentOS 需安装 openldap, openldap-devel 依赖包。27、libxml
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-libxml Disable LIBXML support
−−with-libxml-dir=DIR LIBXML: libxml2 install pix
Debian/Ubuntu 需安装 libxml2, libxml2-dev 依赖包。
Redhat/CentOS 需安装 libxml2, libxml2-devel 依赖包。28、Multibyte String Functions(mbstring)
通过指定编译参数 −−enable-mbstring 安装。 Enable multibyte string support
−−disable-mbregex MBSTRING: Disable multibyte regex support
−−disable-mbregex-backtrack MBSTRING: Disable multibyte regex backtrack check
−−with-libmbfl=DIR MBSTRING: Use external libmbfl. DIR is the libmbfl base install directory BUNDLED
−−with-onig=DIR MBSTRING: Use external oniguruma. DIR is the oniguruma install pix. If DIR is not set, the bundled oniguruma will be used
libmbfl 对 mbstring 是必要的。libmbfl 被捆绑到了 mbstring。
Debian/Ubuntu 需安装 libonig2, libonig-dev 依赖包。
Redhat/CentOS 需安装 oniguruma, oniguruma-devel 依赖包。29、mcrypt
通过指定编译参数 −−with-mcrypt=DIR 安装。 Include mcrypt support
Debian/Ubuntu 需安装 libmcrypt-dev 依赖包。
Redhat/CentOS 需编译安装 libmcrypt 和 mcrypt 。如果安装了 EPEL 的话,则需安装 libmcrypt-devel 依赖包。30、MySQL driver for PDO(pdo_mysql)
−−with-mysql-sock=SOCKPATH MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer
指定系统里安装的 MYSQL 的 mysql.sock 路径。
−−with-pdo-mysql=DIR PDO: MySQL support. DIR is the MySQL base directory
指定系统里安装的 MYSQL 的基本目录。若未指定,则默认安装 mysqlnd(MySQL native driver)31、MySQLi
−−with-mysqli=FILE Include MySQLi support. FILE is the path to mysql_config
指定系统里安装的 MYSQL 的目录下的 mysql_config 文件路径。32、MySQLnd
通过指定编译参数 −−enable-mysqlnd 安装。 Enable mysqlnd explicitly, will be done implicitly when required by other extensions
另如果要给此扩展指定 libz 目录的话,则还有以下的编译参数。
−−with-zlib-dir=DIR mysqlnd: Set the path to libz install pix33、OCI8
−−with-oci8=DIR Include Oracle Database OCI8 support. DIR defaults to $ORACLE_HOME
系统里安装了 Oracle 数据库的话,则指定为 $ORACLE_HOME;否则需安装 Oracle Instant Client,指定为 /path/to/instant/client/lib34、ODBC driver for PDO(pdo_odbc)
−−with-pdo-odbc=flavour,dir
PDO: Support for ‘flavour’ ODBC driver.
include and lib dirs are looked for under ‘dir’.
‘flavour’ can be one of: ibm-db2, iODBC, unixODBC, generic
If ‘,dir’ part is omitted, default for the flavour
you have selected will be used. e.g.:
−−with-pdo-odbc=unixODBC
will check for unixODBC under /usr/local. You may attempt to use an otherwise unsupported driver using the “generic” flavour.
The syntax for generic ODBC support is:
−−with-pdo-odbc=generic,dir,libname,ldflags,cflags
When built as ‘shared’ the extension filename is always pdo_odbc.so35、ODBC
ODBC 有很多种,一般使用如下编译参数即可。
−−with-unixODBC=DIR Include unixODBC support /usr/local
Debian/Ubuntu 需安装 unixodbc, unixodbc-dev 依赖包。
Redhat/CentOS 需安装 unixODBC, unixODBC-devel 依赖包。
注意:PHP 默认会去 /usr/local/include 下去找头文件 sqlext.h,所以还要做个软VPS.COM.IN。
ln -s /usr/include/sqlext.h /usr/local/include/36、OpenSSL
−−with-openssl=DIR Include OpenSSL support (requires OpenSSL >= 1.0.1)
−−with-kerberos=DIR OPENSSL: Include Kerberos support
−−with-system-ciphers OPENSSL: Use system default cipher list instead of hardcoded value
PHP 7.1 所需的 openssl 版本是 >= 1.0.1
PHP 7.0 所需的 openssl 版本是 >= 0.9.8
PHP 5.6 所需的 openssl 版本是 >= 0.9.6
PHP 5.5 所需的 openssl 版本是 >= 0.9.6
PHP 5.4 所需的 openssl 版本是 >= 0.9.6
PHP 5.3 所需的 openssl 版本是 >= 0.9.637、Oracle (OCI) driver for PDO(pdo_oci)
−−with-pdo-oci=DIR PDO: Oracle OCI support. DIR defaults to $ORACLE_HOME.
Use −−with-pdo-oci=instantclient,pix,version for an Oracle Instant Client SDK.
For example on Linux with 11.2 RPMs use:
−−with-pdo-oci=instantclient,/usr,11.238、pcntl
通过指定编译参数 −−enable-pcntl 安装。 Enable pcntl support (CLI/CGI only)39、Perl Compatible Regular Expressions(PCRE)
−−with-pcre-regex=DIR Include Perl Compatible Regular Expressions support. DIR is the PCRE install pix BUNDLED
−−with-pcre-jit Enable PCRE JIT functionality40、PHP Archive(Phar)
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-phar Disable phar support41、PHP Data Objects(PDO)
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-pdo Disable PHP Data Objects support42、Posix
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-posix Disable POSIX-like functions43、PostgreSQL driver for PDO(pdo_pgsql)
−−with-pdo-pgsql=DIR PDO: PostgreSQL support. DIR is the PostgreSQL base install directory or the path to pg_config44、PostgreSQL
−−with-pgsql=DIR Include PostgreSQL support. DIR is the PostgreSQL base install directory or the path to pg_config45、Pspell
−−with-pspell=DIR Include PSPELL support. GNU Aspell version 0.50.0 or higher required
一般需指定其目录,−−with-pspell=/usr
Debian/Ubuntu 需安装 libpspell-dev 依赖包。
Redhat/CentOS 需安装 aspell-devel 依赖包。46、Readline
−−with-readline=DIR Include readline support (CLI/CGI only)
Debian/Ubuntu 需安装 libreadline-dev 依赖包。
Redhat/CentOS 需安装 readline-devel 依赖包。47、Recode
−−with-recode=DIR nclude recode support
Debian/Ubuntu 需安装 librecode-dev 依赖包。
Redhat/CentOS 需安装 recode-devel 依赖包。48、Reflection
此扩展默认为启用。49、Sessions
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-session Disable session support
另如果要给此扩展指定 mm 支持的话,则还有以下的编译参数。
−−with-mm=DIR SESSION: Include mm support for session storage50、Shared Memory Operations(shmop)
通过指定编译参数 −−enable-shmop 安装。 Enable shmop support51、SimpleXML
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-simplexml Disable SimpleXML support
另如果要给此扩展指定 libxml2 目录的话,则还有以下的编译参数。
−−with-libxml-dir=DIR SimpleXML: libxml2 install pix52、SNMP
通过指定编译参数 −−with-snmp=DIR 安装。 Include SNMP support
另如果要给此扩展指定 openssl 目录的话,则还有以下的编译参数。
−−with-openssl-dir=DIR SNMP: openssl install pix
Debian/Ubuntu 需安装 libsnmp-dev 依赖包。
Redhat/CentOS 需安装 net-snmp-devel 依赖包。53、SOAP
通过指定编译参数 −−enable-soap 安装。 Enable SOAP support
另如果要给此扩展指定 libxml2 目录的话,则还有以下的编译参数。
−−with-libxml-dir=DIR SOAP: libxml2 install pix54、Sockets
通过指定编译参数 −−enable-sockets 安装。 Enable sockets support55、SPL
此扩展默认为启用。56、SQLite3
此扩展默认为启用,编译时可通过下列选项禁用:−−without-sqlite3=DIR Do not include SQLite3 support. DIR is the pix to SQLite3 installation directory57、SQLite 3.x driver for PDO(pdo_sqlite)
此扩展默认为启用,编译时可通过下列选项禁用:−−without-pdo-sqlite=DIR PDO: sqlite 3 support. DIR is the sqlite base install directory BUNDLED58、System V Message based IPC
通过指定编译参数 −−enable-sysvmsg 安装。 Enable sysvmsg support59、System V Semaphores
通过指定编译参数 −−enable-sysvsem 安装。 Enable System V semaphore support60、System V Shared Memory
通过指定编译参数 −−enable-sysvshm 安装。 Enable the System V shared memory support61、tidy
通过指定编译参数 −−with-tidy=DIR 安装。 Include TIDY support
一般需指定其目录,−−with-tidy=/usr
Debian/Ubuntu 需安装 libtidy-dev 依赖包。
Redhat/CentOS 需安装 libtidy-devel 依赖包。62、tokenizer
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-tokenizer Disable tokenizer support63、WDDX
通过指定编译参数 −−enable-wddx 安装。 Enable WDDX support
另如果要给此扩展指定 libxml2 目录的话,则还有以下的编译参数。
−−with-libxml-dir=DIR WDDX: libxml2 install pix64、XMLReader
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-xmlreader Disable XMLReader support
另如果要给此扩展指定 libxml2 目录的话,则还有以下的编译参数。
−−with-libxml-dir=DIR XMLReader: libxml2 install pix65、xmlrpc
通过指定编译参数 −−with-xmlrpc=DIR 安装。 Include XMLRPC-EPI support
另如果要给此扩展指定 libxml2 和 iconv 目录的话,则还有以下的编译参数。
−−with-libxml-dir=DIR XMLRPC-EPI: libxml2 install pix
−−with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI66、XML
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-xml Disable XML support67、XMLWriter
此扩展默认为启用,编译时可通过下列选项禁用:−−disable-xmlwriter Disable XMLWriter support68、XSL
通过指定编译参数 −−with-xsl=DIR 安装。 Include XSL support. DIR is the libxslt base install directory (libxslt >= 1.1.0 required)
Debian/Ubuntu 需安装 libxslt1-dev 依赖包。
Redhat/CentOS 需安装 libxslt-devel 依赖包。69、Zip
通过指定编译参数 −−enable-zip 安装。 Include Zip read/write support
另如果要给此扩展指定 libz, PCRE 和 libzip 目录的话,则还有以下的编译参数。
−−with-zlib-dir=DIR ZIP: Set the path to libz install pix
−−with-pcre-dir=DIR ZIP: pcre install pix
−−with-libzip=DIR ZIP: use libzip70、Zlib
通过指定编译参数 −−with-zlib=DIR 安装。 Include ZLIB support (requires zlib >= 1.0.9)
Debian/Ubuntu 需安装 zlib1g-dev 依赖包。
Redhat/CentOS 需安装 zlib-devel 依赖包。71、Zend OPcache
PHP 5.5 之后的版本,此扩展默认为启用,编译时可通过下列选项禁用:−−disable-opcache Disable Zend OPcache support
注意:默认编译安装不代表默认启用,还需配置到 ini 文件里才行。
另外,PHP 还有诸多的第三方扩展,框架,CMS,包管理工具等。举几个例子。
扩展:ZendGuardLoader, ionCube Loader, XCache, Imagemagick, GraphicsMagick, Memcached, Redis, Mongodb, Swoole
框架:Laravel, Symfony, Nette, Yii, Zend Framework, Silex, Slim, CakePHP, ThinkPHP
CMS:Wordpress, Drupal, Joomla, Typecho, Phpcms,
包管理工具:Composer
[日记]历史优惠活动内容
猜你可能想看的VPS
- 二月返场 JGKVM 优惠→香港 CMI 大带宽全场 8 折优惠 年付立香港VPS[主机]
- MySQL 数据库查询字符串长度大于 小于或等于指定值的记录全球[VPS测评]
- phpexcel 设置工作 sheet 名称全球[VPS测评]
- Dataplugs 多线通香港服务器五折起,企业级 E3 E5 服务器,香港VPS[主机]
- 黑五 HostDare 促销→CN2 GT 线路 75 折优惠 CN2 全球[VPS测评]
- 双十一 ZJI→香港大埔机房补货 6 折优惠 香港云地服务器六五折 日本站群服务器[IP]
- Cheapnat→99 元 年 256MB 内存 4GB 空间 300G虚拟空间(主机)
- losangelesvps 洛杉矶 G 口无限流量 vps 特惠,1 核全球[VPS测评]
- 便宜做站 老鹰主机万圣节活动→全场虚拟主机低至 5 折 美国 香港虚拟主美国VPS[主机]
- 偏贵-GeorgeDatacenter→$7 月 32GB 内存 60G虚拟空间(主机)
- VPS 推荐 搬瓦工→DC9 强势回归 1Gbps 洛杉矶 CN2 G全球[VPS测评]
- ViridWeb→€5 月 4GB 内存 100GB SSD 空间 2T虚拟空间(主机)
- tp5 模板中使用自定义函数的方法全球[VPS测评]
- ¥27 月 256M 内存 10G 硬盘 512G 1Gbps KVM 全球[VPS测评]
- RUVDS→30 卢布 月-512MB 10GB 无限流量 俄罗斯全球[VPS测评]
- Virtono→€14.95 年 KVM-512MB 15GB 1TB 全球[VPS测评]
- PacificRack→$8.88 年 KVM-400MB 12GB 1全球[VPS测评]
- WordPress如何代码实现完全禁用REST API全球[VPS测评]
- 弘速云香港vps全场7折促销,走cn2+bgp线路,最低月付26元香港VPS[主机]
- SafeNote 阅后即焚笔记分享服务全球[VPS测评]
- 持续高温!长沙所有初中新生停止军训!全球[VPS测评]
- 网站迁移服务器是如何运作的?新手站长看完这篇文章,很容易就能看完。全球[VPS测评]
- 1分钟快速读懂云计算全球[VPS测评]
- 咖啡主机怎么样?美国洛杉矶高防vps,cn2直连,香港沙田vps美国VPS[主机]
- 者也vps年终特惠:全场云服务器7折终身优惠,赠1G内存,充1000送3全球[VPS测评]
- 世界杯季疫情突发,跨境电商订单排队,义乌商人面临难题全球[VPS测评]
- TabbyCloud:1核512MB内存/20GB/500GB流量/KV香港VPS[主机]
- 弘速科技:香港安畅CN2 GIA/弹性云服务器10元/月,2核1GB/2香港VPS[主机]
- 阿里云香港服务器多少钱一年?香港阿里云服务器价格表香港VPS[主机]
- 野草云vps怎么样?香港美国vps,1核1G3M带宽,38元/月美国VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-28671.html











