Jump to content
thirty bees forum
  • 0

Help


Anima

Question

PrestaShopException

The bcmath extension is required by NumberFormatter.
at line 113 in file vendor/commerceguys/intl/src/Formatter/NumberFormatter.php
php 108. * @throws \RuntimeException 109. */ 110. public function __construct(NumberFormatInterface $numberFormat, $style = self::DECIMAL) 111. { 112. if (!extension_loaded('bcmath')) { 113. => throw new \RuntimeException('The bcmath extension is required by NumberFormatter.'); 114. } 115. $availablePatterns = [ 116. self::DECIMAL => $numberFormat->getDecimalPattern(), 117. self::PERCENT => $numberFormat->getPercentPattern(), 118. self::CURRENCY => $numberFormat->getCurrencyPattern(),
- CommerceGuys\Intl\Formatter\NumberFormatter->__construct - [line 819 - classes/Tools.php]
- [2 Arguments]
php 814. if ($tbCurrency->sign) { 815. $currency->setSymbol($tbCurrency->sign); 816. } 817. $numberFormat = $numberFormatRepository->get($languageIso); 818. 819. => $currencyFormatter = new NumberFormatter($numberFormat, NumberFormatter::CURRENCY); 820. 821. return $currencyFormatter->formatCurrency($price, $currency); 822. } 823. 824. /**
```Argument [0]
CommerceGuys\Intl\NumberFormat\NumberFormat Object ( [locale:protected] => pt [numberingSystem:protected] => latn [decimalSeparator:protected] => , [groupingSeparator:protected] => . [plusSign:protected] => + [minusSign:protected] => - [percentSign:protected] => % [decimalPattern:protected] => #,##0.### [percentPattern:protected] => #,##0% [currencyPattern:protected] => ¤#,##0.00 [accountingCurrencyPattern:protected] => ¤#,##0.00;(¤#,##0.00) )

Argument [1]
3 - **ToolsCore::displayPrice** - [line `285` - `modules/blockcart/blockcart.php`] - [2 Arguments]php
280. $baseShipping = $baseShippingWithTax; 281. } else { 282. $baseShipping = $baseShippingWithoutTax; 283. } 284. } 285. => $shippingCost = Tools::displayPrice($baseShipping, $currency); 286. $shippingCostFloat = Tools::convertPrice($baseShipping, $currency); 287. $wrappingCost = (float) ($params['cart']->getOrderTotal($useTax, Cart::ONLYWRAPPING)); 288. $totalToPay = $params['cart']->getOrderTotal($useTax); 289.
290. if ($useTax && Configuration::get('PS
TAXDISPLAY') == 1) { Argument [0]
0 Argument [1]
Currency Object ( [id] => 1 [name] => Real [iso
code] => BRL [isocodenum] => 986 [sign] => R$ [blank] => 1 [conversion_rate] => 1.000000 [deleted] => 0 [format] => 3 [decimals] => 1 [active] => 1 [prefix] => R$ [suffix] => [webserviceParameters:protected] => Array ( [objectsNodeName] => currencies )

[id_lang] => 
[id_shop] => 1
[id_shop_list] => 
[get_shop_from_context:protected] => 1
[table:protected] => currency
[identifier:protected] => id_currency
[fieldsRequired:protected] => Array
    (
        [0] => name
        [1] => iso_code
        [2] => sign
        [3] => format
        [4] => decimals
        [5] => conversion_rate
    )

[fieldsSize:protected] => Array
    (
        [name] => 32
        [iso_code] => 3
        [iso_code_num] => 3
        [sign] => 8
    )

[fieldsValidate:protected] => Array
    (
        [name] => isGenericName
        [iso_code] => isLanguageIsoCode
        [iso_code_num] => isNumericIsoCode
        [blank] => isInt
        [sign] => isGenericName
        [format] => isUnsignedId
        [decimals] => isBool
        [conversion_rate] => isUnsignedFloat
        [deleted] => isBool
        [active] => isBool
    )

[fieldsRequiredLang:protected] => Array
    (
    )

[fieldsSizeLang:protected] => Array
    (
    )

[fieldsValidateLang:protected] => Array
    (
    )

[tables:protected] => Array
    (
    )

[image_dir:protected] => 
[image_format:protected] => jpg
[def:protected] => Array
    (
        [table] => currency
        [primary] => id_currency
        [multilang_shop] => 1
        [fields] => Array
            (
                [name] => Array
                    (
                        [type] => 3
                        [validate] => isGenericName
                        [required] => 1
                        [size] => 32
                    )

                [iso_code] => Array
                    (
                        [type] => 3
                        [validate] => isLanguageIsoCode
                        [required] => 1
                        [size] => 3
                    )

                [iso_code_num] => Array
                    (
                        [type] => 3
                        [validate] => isNumericIsoCode
                        [size] => 3
                    )

                [blank] => Array
                    (
                        [type] => 1
                        [validate] => isInt
                    )

                [sign] => Array
                    (
                        [type] => 3
                        [validate] => isGenericName
                        [required] => 1
                        [size] => 8
                    )

                [format] => Array
                    (
                        [type] => 1
                        [validate] => isUnsignedId
                        [required] => 1
                    )

                [decimals] => Array
                    (
                        [type] => 2
                        [validate] => isBool
                        [required] => 1
                    )

                [conversion_rate] => Array
                    (
                        [type] => 4
                        [validate] => isUnsignedFloat
                        [required] => 1
                        [shop] => 1
                    )

                [deleted] => Array
                    (
                        [type] => 2
                        [validate] => isBool
                    )

                [active] => Array
                    (
                        [type] => 2
                        [validate] => isBool
                    )

            )

        [classname] => Currency
    )

[update_fields:protected] => 
[force_id] => 

)

- **BlockCart->assignContentVars** - [line `242` - `modules/blockcart/blockcart.php`] - [1 Arguments]php
237. [ 238. 'orderpage' => (strpos($SERVER['PHPSELF'], 'order') !== false), 239. 'blockcarttop' => (isset($params['blockcarttop']) && $params['blockcarttop']) ? true : false, 240. ] 241. ); 242. => $this->assignContentVars($params); 243.
244. return $this->display(FILE, 'blockcart.tpl'); 245. } 246.
247. /** Argument [0]

- **BlockCart->hookRightColumn** - [line `466` - `modules/blockcart/blockcart.php`] - [1 Arguments]php
461. */ 462. public function hookTop($params) 463. { 464. $params['blockcart_top'] = true; 465.
466. => return $this->hookRightColumn($params); 467. } 468. } Argument [0]

- **BlockCart->hookTop** - [line `779` - `classes/Hook.php`] - [1 Arguments]php
774. } 775. } 776.
777. // Immediately return the result if we do not log performances 778. if (!Module::$logmodulesperfs) { 779. => return $module->{$method}($params); 780. } 781.
782. // Store time and memory before and after hook call and save the result in the database 783. $timeStart = microtime(true); 784. $memoryStart = memory
get_usage(true); Argument [0]

- **HookCore::coreCallHook** - [line `497` - `classes/Hook.php`] - [3 Arguments]php
492.
493. // Call hook method 494. if ($hookCallable) { 495. $display = Hook::coreCallHook($moduleInstance, 'hook'.$hookName, $hookArgs); 496. } elseif ($hookRetroCallable) { 497. => $display = Hook::coreCallHook($moduleInstance, 'hook'.$retroHookName, $hookArgs); 498. } 499.
500. // Live edit 501. if (!$arrayReturn && $array['liveedit'] && Tools::isSubmit('liveedit') && Tools::getValue('ad') 502. && Tools::getValue('liveToken') == Tools::getAdminToken( Argument [0]

Argument [1]
hooktop Argument [2]

- **HookCore::execWithoutCache** - [line `280` - `classes/Hook.php`] - [7 Arguments]php
275. $checkExceptions = true, 276. $usePush = false, 277. $idShop = null 278. ) { 279. if (!Configuration::get('TBPAGECACHEENABLED')) { 280. => return static::execWithoutCache($hookName, $hookArgs, $idModule, $arrayReturn, $checkExceptions, $usePush, $idShop); 281. } 282.
283. $activehooks = json
decode(Configuration::get('TBPAGECACHE_HOOKS'), true); 284.
285. $found = false; Argument [0]
displayTop Argument [1]

Argument [2]

Argument [3]

Argument [4]
1 Argument [5]

Argument [6]

- **HookCore::exec** - [line `278` - `classes/controller/FrontController.php`] - [1 Arguments]php
273. $hookheader .= $extracode['PSCUSTOMCODEMETAS'].$extracss; 274.
275. $this->context->smarty->assign( 276. [ 277. 'HOOK
HEADER' => $hookheader, 278. => 'HOOKTOP' => Hook::exec('displayTop'), 279. 'HOOKLEFTCOLUMN' => ($this->displaycolumnleft ? Hook::exec('displayLeftColumn') : ''), 280. 'HOOKRIGHTCOLUMN' => ($this->displaycolumnright ? Hook::exec('displayRightColumn', ['cart' => $this->context->cart]) : ''), 281. ] 282. ); 283. } else { Argument [0]
displayTop - **FrontControllerCore->initContent** - [line `53` - `controllers/front/IndexController.php`]php
48. * 49. * @since 1.0.0 50. */ 51. public function initContent() 52. { 53. => parent::initContent(); 54. $this->addJS(_THEME_JS_DIR_.'index.js'); 55.
56. $this->context->smarty->assign( 57. [ 58. 'HOOK_HOME' => Hook::exec('displayHome'), - **IndexControllerCore->initContent** - [line `390` - `classes/controller/Controller.php`]php
385. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 386. $this->initHeader(); 387. } 388.
389. if ($this->viewAccess()) { 390. => $this->initContent(); 391. } else { 392. $this->errors[] = Tools::displayError('Access denied.'); 393. } 394.
395. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) { - **ControllerCore->run** - [line `742` - `classes/Dispatcher.php`]php
737. if (isset($paramsHookActionDispatcher)) { 738. Hook::exec('actionDispatcher', $paramsHookActionDispatcher); 739. } 740.
741. // Running controller 742. => $controller->run(); 743. } catch (PrestaShopException $e) { 744. $e->displayMessage(); 745. } 746. } 747.
- **DispatcherCore->dispatch** - [line `33` - `index.php`]php
28. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 29. * PrestaShop is an internationally registered trademark & property of PrestaShop SA 30. */ 31.
32. require(dirname(FILE).'/config/config.inc.php'); 33. => Dispatcher::getInstance()->dispatch(); ```

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

It was installed by the browser normally in another VPS, so I had to move the store to another server and did the normal migration. I downloaded the files from the server and uploaded the other files. I use VPS configured by myself, Ubuntu 17.04 (I will migrate to debian 9, 16.04 was with bugs) Apache2, php 7 and ISPConfig

Link to comment
Share on other sites

  • 0

Ah, so the whole stored was just moved from one host to another. That would obviously bypass all the installation checks.

That's an interesting use case that the code doesn't take into consideration now.

In general when something crazy happens it's a smart thing to go into the thirty bees admin, and then to the page 'Advanced Parameters' 'Configuration Parameters' This page would have reported the missing bcmath addon.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...