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 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题