basic PHP server

  • I attempted to follow some dated forum posts for the LAMP addon and although I got close was never able to get a php server fully working. LAMP addon - Linux, Apache, MySQL PHP bundle

    The last posts of the thread suggest using docker, but im having even less success with that (i can muck around, but am no expert)

    is there a simple way to get a basic php server running on libreleec? i dont need SQL, i dont need the latest version of PHP... just a basic instance.

    Im running

    LibreELEC (official): 8.2.5 (Odroid_C2.aarch64)

    Thanks!

  • Unrelated to my media setup i'm seeing if i can use my odroid c2 boxes running Libreelec for a small side project of mine.

    This is where my limited knowledge is made apparent; I just need the equivalent of a hello world script to run on my odroid.

  • If its not too much trouble that would be a big help. I've tried compiling my own but it became clear pretty quickly i'm out of my league.

    Edited once, last by apeg (April 19, 2018 at 5:04 PM).

  • I'll try it this evening, but i have tried:

    service.web.lamp-8.1.102-Odroid_C2.arm.Raybuntu

    i had to edit:

    /storage/.kodi/addons/http://service.web.lamp/bin/httpd.start

    Original:

    Code
    LOCPATH=$ADDON_DIR/lib/locale exec $ADDON_DIR/bin/httpd -d "$ADDON_HOME/srvroot" -f "$ADDON_HOME/srvroot/conf/httpd.conf" -E $ADDON_HOME/httpd.log -e info

    Change:

    Code
    LOCPATH=$ADDON_DIR/lib/locale exec httpd -d "$ADDON_HOME/srvroot" -f "$ADDON_HOME/srvroot/conf/httpd.conf" -e $ADDON_HOME/httpd.log -e info

    *notice the httpd absolute path change along with the -E -> -e option

    following i then disabled mySQL (i dont need it) but when i try and start the httpd service i get the following error:

    Code
    ● httpd.service - Apache Httpd Server
       Loaded: loaded (/storage/.kodi/addons/service.web.lamp/system.d/httpd.service; enabled; vendor preset: disabled)
       Active: activating (auto-restart) (Result: resources) since Thu 2018-04-19 18:54:27 UTC; 1s ago
      Process: 30937 ExecStart=/bin/sh -c exec sh /storage/.kodi/addons/service.web.lamp/bin/httpd.start (code=exited, status=0/SUCCESS)
    
    Apr 19 18:54:27 LibreELEC systemd[1]: Failed to start Apache Httpd Server.
    Apr 19 18:54:27 LibreELEC systemd[1]: httpd.service: Unit entered failed state.
    Apr 19 18:54:27 LibreELEC systemd[1]: httpd.service: Failed with result 'resources'.

    Unfortunately this is as close as I've got.

    Edited once, last by apeg (April 19, 2018 at 8:16 PM).

  • I'm not sure why you change anything in start scripts because they are fine according to

    Code
     ./httpd -h
     -e level           : show startup errors of level (see LogLevel)
     -E file            : log startup errors to file

    Also removing absolute path was probably bad idea.

    But as CvH wrote there are some architectures differences with those builds. Some are 32 bits, some are 64. Seems you are using 64 bit and addon above should work. Just try running httpd from command line to see if it starts. Same for php.

  • Your right, the E->e doesn't seems to effect the result at this point. But the absolute path does.

    either way its still giving me to the same end error.

    I just tried both the packages on fresh images and i cant get them to install:

    service.web.lamp-8.1.102-rpi2.arm.zip

    service.web.lamp-8.2.104-odroid_c2.aarch64.zip

    i've also tried via command line and same result... or rather, no results

    Code
    kodi-send -a "InstallAddon(service.web.lamp)"

    Would trying to compile my own php binary be less/more work than attempting to troubleshoot the lamp install?

    all i really need is basic php support.

    Thanks!

    Edited 3 times, last by apeg (April 24, 2018 at 10:44 PM).

  • this is where my lack of knowledge starts to shine through. A while back I did compile a few builds for my odroid, but this was pre libreeleec and openelec. (and very guided)

    I can’t figure out why none of these builds will install. From the UI kodi doesn’t even acknowledge I attempted to install. I select the zip file and… nothing.

    The lamp addon does significantly more than I need, I don’t even need the latest version of PHP… just basic functionality, is there no other avenue I could explore?

    Thanks again for the help so far

    Edited once, last by apeg (April 25, 2018 at 8:53 PM).

  • I still see no reason why it doesn't work for you. As I wrote did you tried running php from command line? If it doesn't then whole addon is bad.

    Code
    /storage/.kodi/addons/service.web.lamp/bin/php -v
  • Well, turns out i was close...

    service.web.lamp-8.2.104-Odroid_C2.aarch64.zip

    Just noticed that version was put up... and that did the trick perfectly!

    Thanks to whoever put that up, the least i can do is donate some beer money for the help... was that you vpeter or CvH?

    Edited 2 times, last by apeg (April 26, 2018 at 9:22 PM).

  • My fault vpeter, originally CvH and i were talking about the v102 and i didn't even notice the v104 increment.

    Heck i even copied and pasted your link not even noticing it was 104.

    Either way, thanks again for the help, and thanks for releasing v104! did the trick perfectly.

  • Hello @vpeter,

    I tried service.web.lamp-8.2.104-Odroid_C2.aarch64.zip on my H96 Pro+ (Amlogic S912) but all executable are not working:

    # ./httpd

    -sh: ./httpd: not found

    The architecture of my Coreelec 8.95.6 is:

    Linux vdr 3.14.29 #1 SMP Tue Dec 4 13:13:34 GMT 2018 aarch64 GNU/Linux

    and seems to fit to your binaries:

    # file httpd

    httpd: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, stripped

    What's my fault?

    Thanks a lot