a123xxsp Posted February 27, 2017 Posted February 27, 2017 Hi, I cannot find how to install PHP7 on my OrangePiPC 3.4.113-sun8i I installed apache and mariadb by "apt-get install apache2 mariadb-server mariadb-client mariadb.common" but how do I install PHP7? thanX advance, Antonios
a123xxsp Posted March 1, 2017 Author Posted March 1, 2017 any hints or ideas? if there is no repository with php do I have to compile it from source? I tried to find any tutorial for ARM but there are only for Raspberry, can i follow the same procedure?
zador.blood.stained Posted March 1, 2017 Posted March 1, 2017 It depends on OS distribution. Debian Jessie based images have only PHP5 available in the default repositories, and Ubuntu Xenial images do have PHP7. 2
Igor Posted March 1, 2017 Posted March 1, 2017 Perhaps some Google-fu? https://www.google.com/search?q=debian+jessie+install+php7 Most of those general guides applies for Armbian, Jessie version in this case.
tkaiser Posted March 1, 2017 Posted March 1, 2017 3 minutes ago, Igor said: q=debian+jessie+install+php7 I used 'debian Jessie php7 armhf orange pi' instead (armhf to avoid tutorials that work on x86 only and 'Orange Pi' for obvious reasons) and 1st hit is https://www.symfony.fi/entry/install-php-7-on-raspbian-raspberry-pi#comment-2564656832 (though no idea whether the ARMv6 packages were used or compilation from source which I would prefer if I would still use Jessie... which I dropped since Xenial is way better ) 1
Igor Posted March 1, 2017 Posted March 1, 2017 I assume this PHP stuff is common enough that is multi arch compiled + packaged. At least armhf should be well covered in Debian & Ubuntu. I haven't check.
a123xxsp Posted March 1, 2017 Author Posted March 1, 2017 Thanks guys, I was just writing..... " is the procedure similar or same to the one for the Raspberry Pi ? i.e. will this work https://www.stewright.me/2016/03/turn-raspberry-pi-3-php-7-powered-web-server/ I am not familiar with linux and I don't like messing in blind..... " but you answered my questions before I ended my post.... Off-course I've googled it a lot BUT, I was confused by many different approaches... I will try the your suggestions.... and if I make it I'll try to make a short guide.
a123xxsp Posted March 1, 2017 Author Posted March 1, 2017 tkaiser : ... which I dropped since Xenial is way better " Why, Xenial is better? could you post 1-2 bullets? (maybe we should we make a new topic or maybe a poll?) I am looking into building a web server for testing and learning php7 do you think I should change to Xenial? (and install php7 directly from its default repositories!)
zador.blood.stained Posted March 1, 2017 Posted March 1, 2017 13 minutes ago, a123xxsp said: Why, Xenial is better? could you post 1-2 bullets? LTS (long term support) release, so you'll get security fixes for packages for a longer period of time: https://wiki.ubuntu.com/LTS Package base is newer in general compared to current Debian stable (Jessie). Once Debian Stretch is released this won't be true Ubuntu repositories have more packages than Debian 1
Igor Posted March 1, 2017 Posted March 1, 2017 17 minutes ago, a123xxsp said: I am looking into building a web server for testing and learning php7 do you think I should change to Xenial? For learning purposes just go for stock install options, no need for latest PHP versions. Another great library of tutorials: https://www.digitalocean.com/community/tutorials
kasparsd Posted March 3, 2017 Posted March 3, 2017 I've created this script for building the latest version of PHP7 on any Debian based distribution: https://github.com/kasparsd/php-7-debian It worked great on Orange Pi Zero -- here is it running WordPress. 4
a123xxsp Posted March 9, 2017 Author Posted March 9, 2017 THANK YOU guys, I made a new SD with Xenial (as suggested) and installed php7, and exploring the available packages for wordpress testing. "kasparsd" I'll use your script on my other SD, thank you too.
papu Posted April 2, 2017 Posted April 2, 2017 On 3/3/2017 at 8:44 PM, kasparsd said: I've created this script for building the latest version of PHP7 on any Debian based distribution: https://github.com/kasparsd/php-7-debian It worked great on Orange Pi Zero -- here is it running WordPress. Yes, your script is working. I want it to use nginx. Please help to configure with it. $ /usr/local/php7/bin/php -v PHP 7.1.3 (cli) (built: Mar 31 2017 18:57:35) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies 1
Schmurtz Posted April 15, 2018 Posted April 15, 2018 On 3/3/2017 at 4:14 PM, kasparsd said: I've created this script for building the latest version of PHP7 on any Debian based distribution: https://github.com/kasparsd/php-7-debian It worked great on Orange Pi Zero -- here is it running WordPress. Thanks for that ! The script works fine but I'm not able to make the end of the configuration for apache. I found this tutorial but the last step for configuring apache not working : sudo a2enconf php7.0-fpm Any idea or help ?
dando Posted May 13, 2018 Posted May 13, 2018 Hello, I built PHP 7.2.5 on a armv7l single-board computer (Orange Pi PC) running Armbian Stretch (Linux 4.14.18-sunxi). I used this resource as a reference: http://yoestuve.es/blog/compile-php-7-for-raspberry-pi-with-memcached/. However, after compiling and installing successfully, the apache2 webserver cannot start due to the following error: Cannot load /usr/lib/apache2/modules/libphp7.so into server: /usr/lib/apache2/modules/libphp7.so: unexpected reloc type 0x03 Hence, I built PHP once again with the CFLAGS='-fPIC' attribute, but this lead to the same result. Using the mentioned procedure above, I had successfully compiled and installed PHP 7.2.1 before on another SBC (Banana Pi) running Bananian Linux. I already tried downgrading the Apache2 server from 2.4.25-3+deb9u4 to 2.4.25-3+deb9u3 and building and installing PHP 7.2.1. Unfortunately, the error persists. The system is up-to-date. Perhaps some package is missing or is at the wrong version? Here is the output of dpkg --get-selections: https://pastebin.com/yNWuL2v5 Any help would be appreciated. Thank you in advance!
guidol Posted May 14, 2018 Posted May 14, 2018 On 3/1/2017 at 9:31 PM, zador.blood.stained said: Package base is newer in general compared to current Debian stable (Jessie). Once Debian Stretch is released this won't be true I do use debian stretch for my LAMP and installed it the following way: Initial Documentaion which I used: =============================================== https://www.linuxbabe.com/debian/install-lamp-stack-debian-9-stretch Install apache2: =============================================== apt install apache2 apache2-utils systemctl status apache2 sudo systemctl enable apache2 sudo chown www-data:www-data /var/www/html/ -R Install mariadb (now as mysql-replacement): =============================================== sudo apt install mariadb-server mariadb-client systemctl status mariadb sudo systemctl enable mariadb sudo mysql_secure_installation Configure mariadb: =============================================== sudo mariadb -u root MariaDB [(none)]> CREATE DATABASE mydatabase; MariaDB [(none)]> CREATE USER 'guido'@'localhost' IDENTIFIED BY 'myPassword'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON mydatabase.* TO 'guido'@'localhost'; MariaDB [(none)]> CREATE USER 'User2'@'localhost' IDENTIFIED BY 'User2Password'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON mydatabase.* TO 'User2'@'localhost'; MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('myRootPwd'); exit; Install PHP 7.0: =============================================== sudo apt install php7.0 libapache2-mod-php7.0 php7.0-mysql php-common php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-readline phpmyadmin sudo a2enmod php7.0 sudo systemctl restart apache2 php --version Creating PHP info-page: =============================================== sudo nano /var/www/html/info.php <?php phpinfo(); ?> Call PHP-info-page: =============================================== 192.168.6.20/info.php Edit .ini for showing up error in the code: =============================================== php.ini: nano /etc/php/7.0/apache2/php.ini display_errors = on sudo systemctl restart apache2
dando Posted May 15, 2018 Posted May 15, 2018 Unfortunately Debian Stretch includes PHP 7.0 by default. For my needs I would have to install PHP 7.1 or newer. Any recommendation on how to proceed? Thanks!
Recommended Posts