Download the PHP package codemasher/php-ext-xz without Composer
On this page you can find all versions of the php package codemasher/php-ext-xz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codemasher/php-ext-xz
More information about codemasher/php-ext-xz
Files in codemasher/php-ext-xz
Package php-ext-xz
Short Description A PHP Extension providing xz (LZMA2) compression/decompression via PHP streams.
License PHP-3.01
Homepage https://github.com/codemasher/php-ext-xz
Informations about the package php-ext-xz
php-ext-xz
PHP Extension providing XZ (LZMA2) compression/decompression functions (see Implement lzma (xz?) compression).
Installation
The recommended way to install the extension is using PIE:
Windows builds are now done automatically; you can download them from the releases.
Copy the dll file into the /ext directory of your PHP installation and add the line extension=xz-1.x.x-8.5-ts-vs17-x86_64 to your php.ini (whatever the filename may be, you may omit the leading "php_" and the extension), see also: Loading an extension in the PHP manual.
You can check if the extension is loaded via phpinfo(), or from within PHP via:
Basic usage
String-based operations
You can easily compress and decompress strings.
File-based operations
The extension also supports stream-based operations for working with .xz files.
Configuration
You can configure the default compression level and memory limit:
Alternatively, the compression level can be supplied as a parameter to the xzencode() and xzopen() functions:
Build from source
Linux
This module requires liblzma-dev (https://tukaani.org/xz/) as well as php7-dev or php8-dev.
If you are using Ubuntu, you can easily install all of them by typing the following command in your terminal:
To build and install as module, perform the following steps:
Do not forget to add extension=xz.so to your php.ini.
Windows
If you want to build it on your own, follow the steps under "Build your own PHP on Windows" to setup your build environment.
Before the compilation step, clone this repository to [...]\php-src\ext\xz and proceed.
Run the buildtree script and check out the php source:
Clone the xz extension and run the build:
Please note that the liblzma dependency is not included with PHP < 8, so you will need to download it manually and extract it into the deps directory.
Disclaimer
May or may not contain bugs. Use at your own risk.