Symfony: 'zlib extension' missing

大城市里の小女人 提交于 2019-12-11 11:09:53

问题


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

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

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

Thanks.


回答1:


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

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

Example:

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

Thank,



来源:https://stackoverflow.com/questions/29047876/symfony-zlib-extension-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!