Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Installation on Synology NAS Topic is solved

Questions related to installing, updating, setting up and configuring
Post Reply
Vygantas
Posts: 2
Joined: Mon Mar 20, 2023 12:00 pm
nuBuilder Version: 4.5
Been thanked: 1 time

Installation on Synology NAS

Unread post by Vygantas »

Hi,

I am trying to run nuBuilder 4.5 on Synology NAS.
There is already running Apache 2.4, PHP 7.4, MariaDB 10 and phpMyAdmin.
I have set up a database and connection privileges. However when trying to run I get following error message:
"Parse error: syntax error, unexpected '?' in /volume1/web/nubuilder/core/nuchoosesetup.php on line 24 Call Stack: 0.1637 131656 1. {main}() /volume1/web/nubuilder/index.php:0"
What could be the problem? Is it related to the database or PHP version? How to fix it?

Thanks
kev1n
nuBuilder Team
Posts: 3801
Joined: Sun Oct 14, 2018 6:43 pm
nuBuilder Version: 4.5
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: Installation on Synology NAS

Unread post by kev1n »

Hi,

This code uses the null coalescing operator (??), which was introduced in PHP 7.0. Therefore, the minimum PHP version required to run this code is PHP 7.0 and it should work with the PHP version installed on Synology NAS.

I'm uncertain why the syntax is causing an error. It might be a good idea to seek assistance on a Synology NAS forum, where you can find more specialised knowledge on the topic.

In the meantime, you can try replacing the function nuIsHTTPS() in the file nuchoosesetup.php with the one below
that doesn't use the null coalescing operator but uses ternary operators:

Code: Select all

function nuIsHTTPS() {

    $isHttps = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : (
        isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME'] : (
            isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ? $_SERVER['HTTP_X_FORWARDED_PROTO'] : null
        )
    );

    return
        $isHttps && (
            strcasecmp('on', $isHttps) == 0
            || strcasecmp('https', $isHttps) == 0
        )
    ;

}
Vygantas
Posts: 2
Joined: Mon Mar 20, 2023 12:00 pm
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Installation on Synology NAS

Unread post by Vygantas »

Update: Sorry, I found that I was setting the wrong PHP version. This error was with PHP 5.6. After setting PHP 7.3 error disappeared. Thank you!
Post Reply