3

When i installed PHP on Raspberry PI, PHP version is 5.5.* But, I want to install php7 and when i try to compile it from Source Some Error occurs related to sapi Did someone successfully installed php7 on their raspberry pi.

/usr/bin/ld: ext/standard/.libs/image.o: undefined reference to symbol 'uncompress' //lib/arm-linux-gnueabihf/libz.so.1: error adding symbols: DSO missing from command line collect2: ld returned 1 exit status Makefile:268: recipe for target 'sapi/cli/php' failed make: *** [sapi/cli/php] Error 1 p

  • Hello and welcome. Please be more specific about some errors occured to help people give meaningful answers. You can always add your question to include those details. – Ghanima Dec 20 '15 at 9:42
3

Title suggests compilation, but your last question just concerns a successful installation. If you're using Raspbian - which is generally a Debian distribution you can just search for existing .deb files for PHP7. I use `Jessie' version on my rpis, which has available compiled packages: https://www.dotdeb.org/2015/12/04/php-7-0-0-is-available-for-jessie/ for x86/amd64 - it should be easier to recompile source DEBs than to compile all by yourself.

There are also packages for ARM: https://packages.debian.org/search?arch=arm&searchon=sourcenames&keywords=php7.0

For getting help on compilation you need to pass additional info. I'd start with getting apt-get build-dep for available 5.6 version and add dependencies from there.

  • 1
    I am using Raspbian/wheezy, and the armhf packages from debian are not working, it says segmentation fault – ssp singh Dec 21 '15 at 6:47
1

The DSO error is misleading because it makes you think you need to edit / update the Makefile, but in reality, it's actually complaining that it cannot find certain includes or libraries. (In your case, a library).

In my case, I had this issue because I needed to specify the --with-libdir=/usr/lib/arm-linux-gnueabihf and then --with-libxml-dir=/usr and --with-openssl-dir=/usr (the =/usr bit was important, previously, I had =/usr/include).

Once this was corrected, it compiled just fine.

Also, you have to make sure that you have all the dependencies installed.

I have written an installation script that is tested and works on Raspbian 9.9 (Debian 9.9 Stretch), which should work, but otherwise you can use as a reference:

https://github.com/mjmunger/raspberry-pi-php-7.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.