douchang8758 2014-07-28 03:23
浏览 449

PHP在Php.ini中启用bz2扩展

I an trying to download a file using composer in php, but the file needs to be decompress with bzipped. Here is the error I get:

[UnexpectedValueException]                                                   
unable to decompress bzipped phar archive "/home/admin/public_html/subdo  
mains/testing4/vendor/jakoch/phantomjs/da2db411008833dfaa24e92e129aa037.bz2  
" to temporary file, enable bz2 extension in php.ini   

In my php.ini file I have added:

extension = "bz2.so" 

After adding that I still get the error when I try and install the file.

When I run infophp(-1) I get:

bzip2 compression   disabled (install pecl/bz2)

Do I need to enable bzip2? If so how do I do it. Am I doing something wrong with allowing the extension?

  • 写回答

2条回答 默认 最新

  • dsfh40613182 2014-07-28 04:42
    关注

    Enabling an extention in PHP is not only by including it into php.ini file, you need to recompile your PHP installation with package support being enabled, in order to do this for bz2, you have to execute the needed pecl command:

    pecl install bz2
    

    To install pecl you have to install pear and phpize, on a debian based system, the following command should be sufficint:

    apt-get install php5-dev php-pear
    

    Finally you need to add the new extension to php.ini file, Don't forget to reload your web server after that.

    HTH

    评论

报告相同问题?

悬赏问题

  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示