如何在 PHP 7 中启用 bzip2 支持

How to enable bzip2 support in PHP 7

我有一个需要 bzip2 支持的应用程序。我已经安装了库,但不知道如何启用它。默认情况下,它在 PHP 中禁用。

我在互联网上搜索了一整天,但无法正常工作。我是 运行 Debian 8 (Jeezy) 和 PHP 7。感谢任何帮助!

根据 PHP 手册,默认情况下未启用 bzip2 扩展(如您所述)

Bzip2 support in PHP is not enabled by default. You will need to use the --with-bz2[=DIR] configuration option when compiling PHP to enable bzip2 support.

here

根据此引用,您必须自己 编译 PHP 才能启用 bzip2 支持。当然,网上有很多关于如何编译 PHP(例如 here)的资源。反正自己编译未必适合你这样的初学者。您当然可以试一试(您会学到很多东西),但如果您能接触到某种 Linux 专家,方式 会更容易。

你可以简单地安装它。

apt install php7.0-bz2