Ubuntu的16.04 PHP 7 PECL RAR不运行

问题描述 投票:1回答:1

我想使用的RAR扩展与PECL在PHP。我已经完成了安装:http://php.net/manual/en/rar.installation.php但我得到这个错误:“PHP致命错误:未捕获的错误:类‘RarArchive’”当我运行这段代码:

$archive = RarArchive::open($rarfile);
$entries = $archive->getEntries();
foreach ($entries as $entry) {
  $entry->extract('rarfolder');
}
$archive->close();

我已经解决了这个问题:1. PHP -i | grep的扩展2.添加为php.ini:“/usr/lib/php/.../rar.so

php ubuntu-16.04 pecl php-7.0
1个回答
0
投票

作为复制答案评论,希望能够OP其标记为解决:

  1. PHP -i | grep的扩展
  2. 添加为php.ini: “/usr/lib/php/.../rar.so”

另一种解决方案是创建一个类似的文件:

/etc/php/7.0/cli/conf.d/rar.ini 

用下面的内容:

extension=rar.so
© www.soinside.com 2019 - 2024. All rights reserved.