嗨,我是遵循本指南
并尝试在我的 Debian Wheezy(64 位)上安装 php 5.6。
我这样做是因为我的服务器上有 virtualmin,我的 php 版本是 5.4,我需要 5.6 来通过“Duplicator”备份我的 wordpress,但是它至少需要 5.6。
我试图手动安装 php 5.6 (顺便说一句,我找不到包 libdb5.3-dev ),但是当我尝试提取并移动 php5.6 时,它给出了错误。
我尝试使用 wget 几次,但仍然总是出现相同的错误。
这是错误:
root@ns3009614:/# tar -xvjpf /home/downloads/php-5.6.31.tar.gz -C /opt/build
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now
root@ns3009614:/# tar -xvjpf /home/downloads -C /opt/build
tar (child): /home/downloads: Cannot read: Is a directory
tar (child): At beginning of tape, quitting now
tar (child): Error is not recoverable: exiting now
bzip2: Compressed file ends unexpectedly;
perhaps it is corrupted? *Possible* reason follows.
bzip2: Inappropriate ioctl for device
Input file = (stdin), output file = (stdout)
It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.
You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.
tar: Child returned status 2
tar: Error is not recoverable: exiting now
你能帮我一下吗?
谢谢!
答案1
您遇到问题是因为您尝试将该php-5.6.31.tar.gz
文件视为 bzip2 压缩文件。而实际的文件是一个gzip压缩文件。
更改tar -xvjpf php-5.6.31.tar.gz
为tar -xvzf php-5.6.31.tar.gz
,这应该可以解决您的问题。
答案2
/etc/apt/sources.list
通过添加以下行来编辑:
deb http://packages.dotdeb.org wheezy-php56 all
deb-src http://packages.dotdeb.org wheezy-php56 all
获取并安装 GnuPG 密钥:
wget https://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg
安装 PHP 5.6:
sudo apt-get update
sudo apt-get install php5
更多的选择:dotdeb.org 上的说明