Jump to content

Install PHP7 on OrangePiPC 3.4.113-sun8i


a123xxsp

Recommended Posts

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?

 

 

Link to comment
Share on other sites

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 ;) )

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!)

 

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines