12

I'm actually stuck with a little problem. I want to use Laravel on my pi but it requires at least PHP 5.5.9.

But actually, the latest version of PHP that I am able to install (via the official repository) is the 5.4

How can I upgrade to 5.6 (or 5.5.9) ?

goldilocks
  • 60,325
  • 17
  • 117
  • 234
Germain67
  • 222
  • 1
  • 3
  • 8

2 Answers2

10

These are the steps you can follow.

  1. Grab latest source from this site. (http://php.net/downloads.php) Choose your nearest mirror. For example, I did "wget https://www.php.net/distributions/php-5.6.10.tar.bz2"
  2. Unpack it: tar -xvjf php-5.6.10.tar.bz2
  3. cd php-5.6.10
  4. ./configure
  5. make -j4 (if you're compiling it on Rpi 2) else just make
  6. sudo make install
  7. Test it by firing php -v

It should be now upgraded to 5.6

Hope it helps.

dhruvvyas90
  • 2,883
  • 3
  • 21
  • 33
5

At the time of this writing (november 2015), raspbian is built on Debian Jessie. The installable PHP version is in the 5.6 branch.

However, for Laravel projects you will need a number of PHP extensions. Most of these are available in the Raspbian repositories (or out of the box), but the php_mbstring extension cannot be loaded via apt-get.

Instead, to get php5_mbstring run apt-get install libapache2-mod-php5 which includes it (reference comments in http://php.net/manual/en/mbstring.installation.php)

derjoachim
  • 201
  • 3
  • 4