Symfony:缺少“zlib 扩展" [英] Symfony: 'zlib extension' missing

查看:33
本文介绍了Symfony:缺少“zlib 扩展"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 Symfony 开始,但我什至没有通过快速导览...

I wanted to start with Symfony, but I even fail a the Quick Tour...

$ php -r "readfile('http://symfony.com/installer');" > symfony.phar
$ sudo mv symfony.phar /usr/local/bin/symfony
$ chmod a+x /usr/local/bin/symfony

$ symfony 
PHP Fatal error:  Uncaught exception 'PharException' with message 'zlib extension is required for gz compressed .phar file "/usr/local/bin/symfony"' in /usr/local/bin/symfony:9
Stack trace:
#0 /usr/local/bin/symfony(9): Phar::mapPhar('default.phar')
#1 {main}
  thrown in /usr/local/bin/symfony on line 9

Fatal error: Uncaught exception 'PharException' with message 'zlib extension is required for gz compressed .phar file "/usr/local/bin/symfony"' in /usr/local/bin/symfony:9
Stack trace:
#0 /usr/local/bin/symfony(9): Phar::mapPhar('default.phar')
#1 {main}
  thrown in /usr/local/bin/symfony on line 9

我只有 apt-get 的基本知识,不知道如何安装 php 扩展.

I have only rudimentary knowledge of apt-get and no idea how to install php extensions.

我该如何解决这个问题?

How can I solve this problem?

Ubuntu 12.04 LTS

Ubuntu 12.04 LTS

php --version
PHP 5.5.3 (cli) (built: Sep  1 2013 14:29:12)

谢谢.

推荐答案

我认为 PHP 支持 Zlib 但它默认不启用 这里

I think PHP supports Zlib but it is not enable by default Here

您可以在配置 php 以启用 zlib 时添加选项 --with-zlib --with-zlib=DIR.

You can add the option --with-zlib --with-zlib=DIR when you configure your php to enable the zlib.

示例:

php_5.6.7$ ./configure --with-zlib --with-zlib=DIR

php_5.6.7$ ./configure --with-zlib --with-zlib=DIR

谢谢

这篇关于Symfony:缺少“zlib 扩展"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆