Rohan Warwar
Rohan Warwar

Reputation: 850

symfony 3 installer php7 zlib error: zlib extension is required for gz compressed .phar

$ symfony new blog

It printed me:

Uncaught PharException: zlib extension is required for gz compressed .phar file "/usr/local/bin/symfony" in /usr/local/bin/symfony:9

How I can recompile php 7 with this extension, that I installed from apt-get?

Upvotes: 1

Views: 2593

Answers (2)

John Kawakami
John Kawakami

Reputation: 442

My case was for PHP 5.6 on a BSD machine. I needed to enable the zlib.so extension. This extension uses the libz.so shared library. Even if you enabled the extension, it's possible that it wasn't added to your configuration.

Add this line to /usr/local/etc/php/extensions.ini (or wherever this config file is kept):

extension=zlib.so

To check if it worked, use:

php -i

And look for the Phar section.

Upvotes: 0

DevDonkey
DevDonkey

Reputation: 4880

you dont need to recompile PHP to enable this extension.

Make sure you have the zlib library installed.

$ apt-get update && apt-get install libgcrypt11-dev zlib1g-dev

find your ini file:

$ php --ini

should yield your active configuration file path, heres mine.

Configuration File (php.ini) Path: /home/matt/.phpbrew/php/php-7.0.3/etc

then open the php.ini file and find and enable:

zlib.output_compression = On

onwards from there, see here for other config settings.

Upvotes: 1

Related Questions