Home  >  Article  >  Backend Development  >  How to apply extensions in php

How to apply extensions in php

(*-*)浩
(*-*)浩Original
2019-09-29 11:59:091680browse

PHP 扩展库通常称为“php_*.dll”(其中星号代表具体某扩展的名字),位于“PHP\ext”目录下(在 PHP 4 中位于“PHP\extensions”目录下)。

How to apply extensions in php

PHP 发行包中包括了大多数开发者最常用到的扩展库。这些被称为“核心”扩展库。

不过呢,如果用户所需要的功能并没有被任何核心扩展提供,那还是有可能在 PECL 中找到。(推荐学习:PHP视频教程

PHP Extension Community Library(PECL,PHP 扩展社区库)是个 PHP 扩展的储存室,提供了对于所有已知扩展的下载及开发途径的指南。

如果用户开发了一个自己使用的扩展,可以考虑将其发布到 PECL 中以便于其他有相同需求的用户使用。一个很好的副作用是可以得到其他用户的反馈,感谢,错误报告甚至修正/更新。

在 Windows 上有两种加载 PHP 扩展的方式:把扩展编译进 PHP,或者加载 DLL。加载预编译的扩展是更简单更被推荐的方式。

要加载某扩展,需要在系统中有其相对应的“.dll”文件。所有扩展都会由 PHP 小组定期自动编译

用户常常会发现每个 DLL 都有好几个版本:

不同的版本号(至少前两个数字要一致)不同的线程安全性设定不同的处理器体系(x86,x64,...)不同的排错设定其它

请记住用户的扩展设定应该与所使用的 PHP 可执行文件的设定都保持一致。以下脚本可以显示所有 PHP 设定:

phpinfo() call

或者在命令行运行:

drive:\\path\to\php\executable\php.exe -i

The above is the detailed content of How to apply extensions in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn