partkeepr / PartKeepr

Open Source Inventory Management
http://www.partkeepr.org
GNU General Public License v3.0
1.38k stars 400 forks source link

A non well formed numeric value encountered during setup... #1187

Closed gjdunga closed 3 years ago

gjdunga commented 3 years ago

Bug Issue: A non well formed numeric value encountered in /home/partsdatabase/public_html/app/PartKeeprRequirements.php on line 126. WHILE USING partkeepr-1.4.0, Located at: https://downloads.partkeepr.org/partkeepr-1.4.0.zip

Setup: WHILE USING Ubuntu Linux 20.04.1, as GENERATED by Virtualmin 1.962 with Apache/2.4.41 (Ubuntu) and PHP-FPM 7.4.3 Error Log:

Reproduction: Unpack app to a virtualmin based setup of a domain. [ /home/partsdatabase/public_html/ ] Change DocumentRoot in /etc/apache2/sites-available/site.conf to /home/partsdatabase/public_html/web/ ] Chmod all items in /home/parts/database/* to 0775 for "testing"... Add /edit site.conf to read:
`<Directory /home/partsdatabase/public_html> Options +ExecCGI Require all granted AllowOverride All
AddType application/x-httpd-php .php AddType text/html .shtml AddHandler fcgid-script .php AddHandler fcgid-script .php7.4 FCGIWrapper /home/partsdatabase/fcgi-bin/php7.4.fcgi .php FCGIWrapper /home/partsdatabase/fcgi-bin/php7.4.fcgi .php7.4 AddOutputFilter INCLUDES .shtml <Directory /home/partsdatabase/public_html/web/> Require all granted AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch Options +ExecCGI AddType application/x-httpd-php .php AddType text/html .shtml AddHandler fcgid-script .php AddHandler fcgid-script .php7.4 FCGIWrapper /home/partsdatabase/fcgi-bin/php7.4.fcgi .php FCGIWrapper /home/partsdatabase/fcgi-bin/php7.4.fcgi .php7.4 AddOutputFilter INCLUDES .shtml

<Directory /home/partsdatabase/cgi-bin> allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch Require all granted RewriteEngine on RemoveHandler .php RemoveHandler .php7.4 php_admin_value engine on FcgidMaxRequestLen 1073741824 IPCCommTimeout 9999 LogLevel debug ` Open site In browser: RESULT: Web Result

Log files report: [Sun Feb 07 18:04:58.918153 2021] [fcgid:warn] [pid 14758] [client 2607:fb90:6c8c:cc4a:d56c:411c:cfea:6f58:58399] mod_fcgid: stderr: PHP Notice: A non well formed numeric value encountered in /home/partsdatabase/public_html/app/PartKeeprRequirements.php on line 126,

CODE IN QUESTION: PartKeeprRequirements.php

116: protected function returnBytes($val) 117: { 118: $val = trim($val); 119: $last = strtolower($val[strlen($val) - 1]); 120: switch ($last) { 121: // The 'G' modifier is available since PHP 5.1.0 122: case 'g': 123: $val = 1073741824; 124: break; 125: case 'm': 126: $val = 1048576; 127: break; 128: case 'k': 129: $val *= 1024; 130: break; 131: } 132: 133: return $val;

QUESTION: Obviously I must have modified my php or something to bjork something... Can you please review and help me track down my stupid mistake?

// Gabriel

gjdunga commented 3 years ago

This persisted even after re-installing bc-math...

gjdunga commented 3 years ago

Reverting to PHP 7.1.3.3 after reading other errors....

gjdunga commented 3 years ago

Reverting to PHP 7.1.3.3 fixed the errors... Why is Symphony so hard to change for newer versions of php???

christianlupus commented 3 years ago

Why is Symphony so hard to change for newer versions of php???

We need to change Symfony version not make the present Symfony version compatible with PHP 7.2 and later. This is the basic framework we are relying upon. If you are capable to update, we will happily accept your graceful support.

gjdunga commented 3 years ago

Christian, I'll be honest, my skills are not very adept yet. I am a master at Google-Fu™ to look up bugs and try to tweak and get something installed, but ask me to try to write something from scratch and I would be tearing my hair out. I want to change that, oh how I need to change that... I will ponder your request and perhaps I can see what has changed between the two frameworks and if you are willing to help double check me I would be happy to participate.

gjdunga commented 3 years ago

Other than dealing with rolling release churn, is there something you are aware of that would totally break? Yes, I know it's spoilers but, it never hurts to ask.

christianlupus commented 3 years ago

I think, here @ericmoon is better suited to answer. He already had started to work on some topics and even succeeded in some parts as far as I know. You should synchronize with him any work.