ubuntu 16.04 pecl 不能安裝 mcrypt

Posted fsong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu 16.04 pecl 不能安裝 mcrypt相关的知识,希望对你有一定的参考价值。

vagrant@ubuntu-xenial:/etc/apt$ sudo pecl install mcrypt-1.0.1
downloading mcrypt-1.0.1.tgz ...
Starting to download mcrypt-1.0.1.tgz (33,782 bytes)
.........done: 33,782 bytes
php Fatal error:  Cannot use result of built-in function in write context in /usr/share/php/Archive/Tar.php on line 639
PHP Stack trace:
PHP   1. main() /usr/share/php/peclcmd.php:0
PHP   2. require_once() /usr/share/php/peclcmd.php:31
PHP   3. PEAR_Command_Install->run() /usr/share/php/pearcmd.php:316
PHP   4. PEAR_Command_Install->doInstall() /usr/share/php/PEAR/Command/Common.php:270
PHP   5. PEAR_Downloader->download() /usr/share/php/PEAR/Command/Install.php:666
PHP   6. PEAR_Downloader_Package->download() /usr/share/php/PEAR/Downloader.php:473
PHP   7. PEAR_Downloader_Package->_fromUrl() /usr/share/php/PEAR/Downloader/Package.php:262
PHP   8. PEAR_PackageFile->fromAnyFile() /usr/share/php/PEAR/Downloader/Package.php:1599
PHP   9. PEAR_PackageFile->fromTgzFile() /usr/share/php/PEAR/PackageFile.php:473

Fatal error: Cannot use result of built-in function in write context in /usr/share/php/Archive/Tar.php on line 639

Call Stack:
    0.0001     406048   1. main() /usr/share/php/peclcmd.php:0
    0.0008     482248   2. require_once('/usr/share/php/pearcmd.php') /usr/share/php/peclcmd.php:31
    0.1163    2084928   3. PEAR_Command_Install->run() /usr/share/php/pearcmd.php:316
    0.1163    2084928   4. PEAR_Command_Install->doInstall() /usr/share/php/PEAR/Command/Common.php:270
    0.6323    3353264   5. PEAR_Downloader->download() /usr/share/php/PEAR/Command/Install.php:666
   14.7371    4418416   6. PEAR_Downloader_Package->download() /usr/share/php/PEAR/Downloader.php:473
   14.7382    4421888   7. PEAR_Downloader_Package->_fromUrl() /usr/share/php/PEAR/Downloader/Package.php:262
   17.2164    4423688   8. PEAR_PackageFile->fromAnyFile() /usr/share/php/PEAR/Downloader/Package.php:1599
   17.2165    4423728   9. PEAR_PackageFile->fromTgzFile() /usr/share/php/PEAR/PackageFile.php:473
pear list
vagrant@ubuntu-xenial:/etc/php$ pear list
Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.4.3   stable
Console_Getopt   1.4.1   stable
PEAR             1.10.1  stable
PEAR_Manpages    1.10.0  stable
Structures_Graph 1.1.1   stable
XML_Util         1.3.0   stable

更新 Archive_Tar

sudo pear upgrade Archive_Tar

Archive_Tar upgrade to Archive_Tar 1.4.3 version,問題就解決了

sudo pecl install mcrypt-1.0.1

參考

  1. Remove unneeded by-reference on built-in fuction
  2. PHP 7.2 compatibility: Upgrade to Archive_Tar 1.4.3 needed
  3. Issue in installing php7.2-mcrypt
  4. How to install mcrypt in php7.2 Main
  5. PEAR 软件包的安装
  6. php-pear broken on php 7.2

以上是关于ubuntu 16.04 pecl 不能安裝 mcrypt的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu16.04安裝最新Nvidia驱动

沈逸老师ubuntu速学笔记-- ubuntu16.04下 apache2.4和php7结合编译安装,并安裝PDOmysql扩展

ubuntu phpize 安裝

Ubuntu 16.04 升级 PHP 版本至 7.1

Ubuntu16.04 sogou中文输入出现乱码(亲测有效)

ubuntu16.04+matlab r2015b VideoReader报错