Topic: Nginx server and PHP version

I am serving FrontAccounting on Ubuntu on a Nginx server and I have the problem with PHP version and I don't know how to handle it, I have the following problems:

PHP v.7.0: mysqli_connect(): The server requested authentication
PHP v.7.4: Trying to access array offset on value of type bool En archivo : /var/www/..../admin/db/tags_db.inc en la línea80
PHP v.8.0: A lot of message with deprecated functions.

I set 7.4 because although the problem it is working, can you help me to know what should I do?. Thanks in advance.

Re: Nginx server and PHP version

Regarding 7.4, you can safely ignore the error.

PHP 7.4 has better validation than earlier php.  I fixed a lot of these issues in my fork and I still need to post the fixes.  The fix for db_tags.inc is:

diff --git a/core/admin/db/tags_db.inc b/core/admin/db/tags_db.inc
index b33de82..96bdbe9 100644
--- a/core/admin/db/tags_db.inc
+++ b/core/admin/db/tags_db.inc
@@ -77,7 +77,7 @@ function get_tag_name($id)
        $result = db_query($sql, "could not get tag name");
        
        $row = db_fetch_row($result);
-       return $row ? $row[0] : '';
+       return $row == false ? false : $row[0];
 }

Re: Nginx server and PHP version

Thanks a lot! I will follow your advice!

Re: Nginx server and PHP version

Genius!!!! It works perfectly, thanks a million!

5 (edited by cedricktshiyoyo 05/05/2021 09:54:09 am)

Re: Nginx server and PHP version

Function get_magic_quotes_gpc() is deprecated in file: /var/www/html/finance/includes/session.inc at line 308
Trying to access array offset on value of type bool in file: /var/www/html/finance/gl/includes/db/gl_db_accounts.inc at line 220
implode(): Passing glue string after array is deprecated. Swap the parameters in file: /var/www/html/finance/includes/ui/ui_lists.inc at line 151

Hello guys, i am having the same message, I am using ubuntu 20.04 with php 7.4.3   mysql  Ver 8.0.23-0ubuntu0.20.04.1

Any idea?

Re: Nginx server and PHP version

Hello Cedrick! Are you using 2.4.9 version? It's supposed to working well in this version.

Re: Nginx server and PHP version

I understand you have to download now the 2.4.9 version from SourceForge and install it again and it should work.

----------
install/isession.incDiffSwitch to side-by-side view
--- a/install/isession.inc
+++ b/install/isession.inc
@@ -31,7 +31,7 @@
//
function strip_quotes($data)
{
-    if(get_magic_quotes_gpc()) {
+    if(version_compare(phpversion(), '5.4', '<') && get_magic_quotes_gpc()) {
        if(is_array($data)) {
            foreach($data as $k => $v) {
                $data[$k] = strip_quotes($data[$k]);

Re: Nginx server and PHP version

lugezz wrote:

I understand you have to download now the 2.4.9 version from SourceForge and install it again and it should work.

----------
install/isession.incDiffSwitch to side-by-side view
--- a/install/isession.inc
+++ b/install/isession.inc
@@ -31,7 +31,7 @@
//
function strip_quotes($data)
{
-    if(get_magic_quotes_gpc()) {
+    if(version_compare(phpversion(), '5.4', '<') && get_magic_quotes_gpc()) {
        if(is_array($data)) {
            foreach($data as $k => $v) {
                $data[$k] = strip_quotes($data[$k]);

thanks it worked fine

Re: Nginx server and PHP version

@joe: can include this?