Configure Webserver with PHP and MariaDB in F4-210

Using Web Server, PHP, MySQL, MariaDB.
Post Reply
User avatar
salogarzon
Posts: 3
Joined: 09 Apr 2021, 23:44

Configure Webserver with PHP and MariaDB in F4-210

Post by salogarzon »

I have correctly installed WebServer and tried PHP with an script calling phpinfo(). All is correct except the mysqli extension doesnt appear in the list of things in phpinfo. In fact I try a test script to connect to MariaDB using mysqli_connect and the result is :
Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /mnt/md0/appdata/col/testterra.php
Can anyone help me on how to activate the mysqli extension? Many tanks!
User avatar
TMSupport
TerraMaster Team
Posts: 2314
Joined: 13 Dec 2019, 15:15

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by TMSupport »

We have received your email via support(at)terra-master.com. We may have to remotely check it, please contact with support by email.
To contact our team, please send email to following addresses, remember to replace (at) with @
Technical team: support(at)terra-master.com (for technical support)
Service team: service(at)terra-master.com (for purchasing, return, replacement, RMA service)
User avatar
tatay
Posts: 5
Joined: 04 May 2021, 04:27

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by tatay »

HI!
I have been fighting the SAME problem with a new F4-210 ... PHP mysqli seems to be disabled for the TOS - webserver app = makes it useless to me...
On the other hand mysqli IS WORKING when I load the the built-in phpMyAdmin application (which seems to be loading in a separate environment/ Iframe)
While I can understand the delay in answering (will have to refer to the tech team...?) - I am not impressed that there is no follow-up reply after 3 weeks which would enable others to see a/the solution...

This is my first purchase of a TM product (bought it for my sister) ...

SURPRISINGLY the help pages are from 2017 ... and seem to refer to an older version of TOS...
From the descriptions I WAS of the opinion that this is based on CentOS (soon to be discontinued by RHEL!)...
HOWEVER, there appears to be no packet management and the back-end (ssh) seems to be largely dysfunctional ... (configuration files an libraries are not there or not in their default path...

IMHO this product is (ATM) not suitbale to be recommended beyond basic file sharing and elementary media streaming...

hope you can share the reply to the question of the OP - thanks!
User avatar
TMS
TerraMaster Team
Posts: 508
Joined: 20 Oct 2020, 17:06

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by TMS »

Hi,
We are revising the help pages,Is it possible to let our engineer check it remotely?You can send an email to our tech team to confirm it.
please refer to this link:viewtopic.php?f=75&t=608
To contact our tech team, please email to support(at)terra-master.com, remember to replace (at) with @
User avatar
salogarzon
Posts: 3
Joined: 09 Apr 2021, 23:44

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by salogarzon »

Since my last post I`ve been investigating,
this is what i've found in /var/log/http_error_log:
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib/php/mysqli.so (/usr/lib/php/mysqli.so: undefined symbol: mysqlnd_global_stats), /usr/lib/php/mysqli.so.so (/usr/lib/php/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
The library is effectivly in the path /usr/lib/php but unable to load but Apache can't load the MySQL libraries. Looks like the binaries are incompatible or compiled erroneously. My level of linux keeps me from going any further.
User avatar
tatay
Posts: 5
Joined: 04 May 2021, 04:27

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by tatay »

YES, same here - a fresh install...
1) the installed search path to all extension modules including mysql.so is WRONG
2) after correcting the path the xxxxx.so files ARE FOUND
3) NOW the files are incompatible (php is version 7.2 and wants modules 2017 ) the installed modules in /usr/lib/php are dated June 5 2020 ...

Apparently there is a NEWER package of Apache available which includes PHP7.4 HOWEVER this is only packaged for x64 models (i.e. the INTEL versions)
(sorry, I have customers who got burned by ReadyNAS with their INFRANT porcessor and no more support / and this looks the same to me ... - hope I am wrong)

and NO, since TerraMaster access via open port has previously exposed these NAS models to ransom ware attacks I will NOT open it to the "tech guys" who are unable to package correct versions...SORRY, TerraMaster...I will send this back to you and your technicians can investigate...

Then again, a help page for TOS which is 4+ years out of date...
I find process.sock and process.pid in the /var/log directory??? whoever is writing this TOS needs to finish the last 4 years of college... :geek:
User avatar
theka7
Posts: 1
Joined: 11 May 2021, 04:14

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by theka7 »

I am having the same issue with this. I am brand new to TOS. phpinfo shows that mysqli is included and I can access/see my database contents through MariaDB and phpMyAdmin, but I can't call the mysqli function to display the db contents on a web page.
User avatar
tatay
Posts: 5
Joined: 04 May 2021, 04:27

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by tatay »

theka7 wrote: 11 May 2021, 04:16 I am having the same issue with this. I am brand new to TOS. phpinfo shows that mysqli is included and I can access/see my database contents through MariaDB and phpMyAdmin, but I can't call the mysqli function to display the db contents on a web page.
Hi @theka7

Well, the phpmyadmin AND MariaDB applications do run from "within" the TOS (nginx?) environment which seems to load the mysql.so correctly.
AFAICS the problem is with "web-server" add-on/application. THIS does NOT load any of the required ".so" modules ...
1st with the default setup (i.e. as installed by TOS) it can not "find" the ".so" files ...
Then (when I change the path to the 'only available/installed' .so files) it DOES pick them up... but the version is not matched to the installed php7.2 therefore the modules still do not load - then php7.2 has no way of accessing the MariaDB sql data (which IS correctly installed and running - as we have both discovered by running phpMyAdmin).
Regretfully I am more at home in the Debian/Ubuntu environment and have to look up a lot of the common defaults for this TOS (Centos based???)... then there is no repository and no package management to "easily" fix the underlying problems...

Conclusion: TOS was apparently built from OpenWRT (Centos based) kernel... with a number of file locations and configurations in non-standard locations... = hard to trace and fix (even the log files are not written or not in the /var/log location (in exchange we find running .pid and .sock in the /var/log location =messy coding). I can not say if this is inherited from the underlying kernel or introduced by TerraMaster...

From the reply (or lack thereof) here I do not get a comfortable feeling. It seems we have a relatively decent hardware product paired with not so well maintained code/OS.

ONLY hope that Terramaster would provide the source code to their TOS allowing users to compile a new/working TOS... perhaps a community effort would work better and be able to address concerns (e.g. forced logout timer causes session expired error and requires TWO login attempts to get back...YIKES!)

Since the underlying OpenWRT is GNU/GPL TerraMaster "should" provide the code ... don't see it anywhere...
User avatar
tatay
Posts: 5
Joined: 04 May 2021, 04:27

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by tatay »

{L_BUTTON_AT}TMSupport

Hell Support Team!

Have you been able to resolve the problem in the last 4 weeks???
Would you kindly post your solution here for other who are affected to resolve the problem as well???

IMHO it is not very helpful to use PM for resolution of problems like this ... it even increases the workload on your teams by having to repeat the same investigation/answer multiple times...

Thanks!
User avatar
SINSENAS
Posts: 6
Joined: 08 Mar 2022, 06:06

Re: Configure Webserver with PHP and MariaDB in F4-210

Post by SINSENAS »

Seriously its horrible.. I sold my terra master now. are imposible that work fine ... never app work decently, Mariadb, error, webadmin, error, Wordpress error, and if can fix this, comandante line ( more that 2 hours to start use Wordpress or other thing because need surf in webpages without info of this..

or fix you app for work fine, put a video that how work in other brands.... easy .. if want a windows 2003 server.. purchase windows 2003 server not a NAS, difficult, complicate,and horrible work with this.

https://youtu.be/RheTjPXYWSI
Post Reply