8

I was wondering about how to install PHP 5.6.x on my Raspberry Pi. Currently version 5.4.41 is installed and because of the new specs i'd like to upgrade to 5.6.10. I've seen this tutorial but the console's output tells me something went wrong.

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.

What's the problem here?

EDIT: Am I really getting downvotes here? For asking a question?

lenny.myr
  • 903
  • 2
  • 11
  • 20

3 Answers3

12

I had the same problem and I solved it this way:

# 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
tleb
  • 4,395
  • 3
  • 25
  • 33
  • This is the right way to install PHP 5.6. I have tried many solutions but none worked due to unknown characters in the repo-name. This one works on Raspbian Wheezy. – Jeroen Dec 01 '15 at 08:45
  • 2
    The problem with installing from source is that it doesn't give you a good way to track updates in the upstream code, which tends to lead to security problems not being addressed. – mc0e Dec 10 '15 at 19:03
  • This is a great answer! Just what I was looking for. Thanks. – Jonas Lomholdt Jan 14 '16 at 17:19
3

ARM-CPUs are not supported, only i386 and amd64

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

random-forest-cat
  • 33,652
  • 11
  • 120
  • 99
falsecrypt
  • 1,536
  • 14
  • 11
1

Well you can use the deb-src part from the tutorial to download an easily build a deb-package.

Note that i'm just writing this out of my head-

The following will install all dependencies to your system

sudo apt-get build-dep php5

as root or using fakeroot:

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

Probably snoop-around with apt-file search for missing headers and install some -dev packages and other stuff on recommendation from the build script.

As root:

dpkg -i *.deb

Hope it helps

Debian is usually quite beautiful.

AiO
  • 11
  • 1