partkeepr / PartKeepr

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

Error during setup PHP prerequisites check #953

Closed gconus closed 4 years ago

gconus commented 6 years ago

When I was trying to install Partkeepr, I got an error during the PHP prerequisites check.

In the file app/PartKeeprRequirements.php at the lines 109 to 13, the code is supposed ton convert a value in $val from a string to a number in byte. For that purpose, the last character of the string is the multiplier suffix. However, this is the whole string which is multiplicated in the swtich-case. The last letter should be removed before the multiplication in order to avoid the error.

I added right before the switch, after line 119 the following instruction : $val = substr($val, 0, -1);. It fixed the problem and I could pass the check and install Partkeepr.

System Information

How to reproduce

when opening in the browser the web/setup/index.html page and launching the check, the error will occur if you have an cache size specified in your php.ini with a suffix letter 'M', 'k' or 'G'. It will be an error that would be non JSON and won't display any information when clicking the button show errors.

christianlupus commented 4 years ago

As far as I see, this is already implemented in the code.

@gconus Can you verify this is the line you are referring to?