• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

PHP 7.3 FPM module moves decimal places

Marcel Zimmer

New Pleskian
Good morning, dear Forum,

unfortunately I have a problem with the PHP 7.3 FPM module (Apache and NGINX - both the same problem)
Since I installed the PDO SQLSRV MOdul with these instructions,

How to install the sqlsrv extension for PHP 7.x?

the prices are displayed wrong under PHP 7.3 as FPM module. It seems to me almost as if the , is shifted some places to the right and filled up with more zeros. Once I switch PHP to FastCGI, the problem is gone. However I would like to switch back to the FMP module for performance reasons. Do any of you happen to know this behavior and maybe even have a solution for me?

Bild1.png is the output with FPM Modul
Bild2.png is the output with FastCGI Module

I would be very happy about your feedback.

Used Versioen:
OS: Ubuntu 16.04.6 LTS
Plesk Obsidian 18.0.21 Update #3 , last updated at Nov 26, 2019 06:27 AM

Thank you very much
 

Attachments

  • Bild1.PNG
    Bild1.PNG
    144.3 KB · Views: 14
  • Bild2.PNG
    Bild2.PNG
    144.1 KB · Views: 13
The reason for the behavior is probably a wrong locale in the PHP configuration or the shop. For example, in the U.S. the decimal separator is a "." and the thousands-separator is a ",". In Europe it is the other way round. What happens in your software is that the price is formatted with a comma as a thousands separator, so that a subsequent display function that is using the obviously US (or similar) locale thinks that this must be the thousands separator, so it moves the number to the left.

The root cause: Probably the installation of the extension, that has made changes to your existing PHP-FPM configuration file.

Solution: Check your php-fpm configuration file for the domain in question and correct the locale to your real location, for example de_DE for Germany, if there is anything set regarding internationalization. File path: /opt/plesk/php/7.3/etc/php.ini (for PHP 7.3 for example). In a normal setup, the php.ini file must not contain anything regarding a specific locale, so you might as well comment things that you find out. I cannot think of something that could be in here regarding locales, but maybe you find something.

Check your shop configuration, too, what locale is set there. When both are in sync, the issue should not occur.

Another approach could be to check how the data is stored in your database. Normally, it should be stored in a type of number field (e.g. a decimal field) and the dot should be used as the decimal separator. But it might be the case that the software is using a string type field for it and storing the numbers as strings with a comma as a decimal separator.
 
Hi Peter,

thank you very much for your answer. I have checked the php.ini file but i dind't found anything in this direction. But i have checjed the default locale for plesk himself and found that it was set to en-EN

locales: Plesk Locales

after switching this to de-DE it show the right Price :)
 
hi,

I was happy to suffer too soon. It was data from the cache - unfortunately there are still wrong prices displayed.

Enclosed an excerpt of the php.ini

is something missing or wrong here?
 

Attachments

  • php_ini.pdf
    153.1 KB · Views: 2
Back
Top