【问题标题】:How to install PHP 5.6 on Raspbian wheezy?如何在 Raspbian wheezy 上安装 PHP 5.6?
【发布时间】:2015-09-25 16:04:19
【问题描述】:

我想知道如何在我的 Raspberry Pi 上安装 PHP 5.6.x。当前版本 5.4.41 已安装,并且由于新规范我想升级到 5.6.10。我见过this tutorial,但控制台的输出告诉我出了点问题。

pi@raspberry:~$ sudo apt-get update
Hit http://packages.dotdeb.org wheezy-php56 Release.gpg
Hit http://archive.raspberrypi.org wheezy Release.gpg                
Get:1 http://mirrordirector.raspbian.org wheezy Release.gpg [490 B]  
Hit http://raspberrypi.collabora.com wheezy Release.gpg                                          
Hit http://packages.dotdeb.org wheezy-php56 Release                  
Get:2 http://mirrordirector.raspbian.org wheezy Release [14,4 kB]    
Hit http://raspberrypi.collabora.com wheezy Release                  
Hit http://archive.raspberrypi.org wheezy Release                    
Hit http://packages.dotdeb.org wheezy-php56/all Sources              
Hit http://raspberrypi.collabora.com wheezy/rpi armhf Packages
Hit http://archive.raspberrypi.org wheezy/main armhf Packages                               
Get:3 http://mirrordirector.raspbian.org wheezy/main armhf Packages [6.904 kB]          
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en_US                                
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en                 
Ign http://archive.raspberrypi.org wheezy/main Translation-en_US
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Get:4 http://mirrordirector.raspbian.org wheezy/contrib armhf Packages [23,6 kB]
Get:5 http://mirrordirector.raspbian.org wheezy/non-free armhf Packages [49,3 kB]
Get:6 http://mirrordirector.raspbian.org wheezy/rpi armhf Packages [592 B]
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_US
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_US
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_US
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_US
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en
Fetched 6.992 kB in 21s (329 kB/s)
W: Failed to fetch http://packages.dotdeb.org/dists/wheezy-php56/Release  Unable to find expected entry 'all/binary-armhf/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.

这里有什么问题?

编辑:我真的在这里被否决了吗?问个问题?

【问题讨论】:

  • 那些投反对票的人应该提供反馈 - 流氓投票只会混淆视听。

标签: php raspbian apt raspberry-pi2


【解决方案1】:

我遇到了同样的问题,我是这样解决的:

# Get the PHP source
# You can find the latest version number on the PHP download page: http://php.net/downloads.php
# Change `nl1` to your nearest mirror. Find the mirror list here: http://php.net/mirrors.php.
wget http://nl1.php.net/distributions/php-5.6.13.tar.bz2

# Unpack
tar -xvjf php-5.6.13.tar.bz2

cd php-5.6.13

sudo apt-get update
sudo apt-get install libxml2-dev
./configure

# If on the Raspberry Pi 2
make -j4
# Otherwise
make

sudo make install

# Reboot to make sure changes are effective
sudo reboot

# Check PHP version
php -v

【讨论】:

  • 这是安装 PHP 5.6 的正确方法。我尝试了许多解决方案,但由于回购名称中的未知字符,没有一个有效。这个适用于 Raspbian Wheezy。
  • 从源代码安装的问题在于它没有为您提供跟踪上游代码更新的好方法,这往往会导致安全问题得不到解决。
  • 这是一个很好的答案!正是我想要的。谢谢。
【解决方案2】:

不支持 ARM-CPU,仅支持 i386 和 amd64

http://packages.dotdeb.org/dists/wheezy-php56/all/

【讨论】:

    【解决方案3】:

    你可以使用教程中的 deb-src 部分下载一个轻松构建的 deb 包。

    请注意,我只是在脑海中写下这个-

    以下会将所有依赖项安装到您的系统中

    sudo apt-get build-dep php5
    

    作为 root 或使用 fakeroot:

    apt-get source php5
    cd php5-5.6.33/
    debian/rules build
    

    可能使用 apt-file 搜索丢失的标头并根据构建脚本的建议安装一些 -dev 包和其他东西。

    作为根:

    dpkg -i *.deb
    

    希望对你有帮助

    Debian 通常很漂亮。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      相关资源
      最近更新 更多