[Skip to main content](#vessel-content)

#   Division by zero and Out of memory

##

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

14 years 5 months ago -  14 years 5 months ago [\#50814](#50814) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  *[Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50814 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")* was created by *[erickb](/forum/user/4069-erickb "View erickb's Profile")*

I am getting these errors

PHP Warning: Division by zero in ./administrator/components/com_hikashop/classes/currency.php on line 1077

PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421
PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224

Last edit: 14 years 5 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

14 years 5 months ago [\#50895](#50895) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50895 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

Please remember that you're using a pre release version. That line is different in the latest version, in your pre version and in our dev environment.
So I don't know what you have on that line. Could you copy/paste the code there ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

14 years 5 months ago -  14 years 5 months ago [\#50911](#50911) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50911 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

// commentar on the line

PHP Warning: Division by zero in ./administrator/components/com_hikashop/classes/currency.php on **line 1077**
Code:

if(bccomp($coupon-&gt;discount_flat_amount,0,5)){[b] [/b]$coupon-&gt;discount_flat_amount_orig = round($coupon-&gt;discount_flat_amount,(int)$currenciesData[$coupon-&gt;discount_currency_id_orig]-&gt;currency_locale['int_frac_digits']); if($srcCurrency-&gt;currency_id!=$mainCurrency-&gt;currency_id){ if(bccomp($srcCurrency-&gt;currency_percent_fee,0,2)){ $coupon-&gt;discount_flat_amount+=$coupon-&gt;discount_flat_amount*floatval($srcCurrency-&gt;currency_percent_fee)/100.0; } $coupon-&gt;discount_flat_amount=(floatval($coupon-&gt;discount_flat_amount)/floatval($srcCurrency-&gt;currency_rate)); // line 1077 } if($dstCurrency-&gt;currency_id!=$mainCurrency-&gt;currency_id){ $coupon-&gt;discount_flat_amount=floatval($coupon-&gt;discount_flat_amount)*floatval($dstCurrency-&gt;currency_rate); if(bccomp($dstCurrency-&gt;currency_percent_fee,0,2)){ $coupon-&gt;discount_flat_amount+=$coupon-&gt;discount_flat_amount*floatval($dstCurrency-&gt;currency_percent_fee)/100.0; } } $coupon-&gt;discount_flat_amount=round($coupon-&gt;discount_flat_amount,(int)$currenciesData[$coupon-&gt;discount_currency_id]-&gt;currency_locale['int_frac_digits']); }else{ $coupon-&gt;discount_flat_amount=0; }

PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on **line 421**
Code:

protected function bindData(&amp;$parent, $data) { // Ensure the input data is an array. if (is_object($data)) { $data = get_object_vars($data); } else { $data = (array) $data; } foreach ($data as $k =&gt; $v) { if ((is_array($v) &amp;&amp; JArrayHelper::isAssociative($v)) &#124;&#124; is_object($v)) { $parent-&gt;$k = new stdClass; $this-&gt;bindData($parent-&gt;$k, $v); } else { $parent-&gt;$k = $v; // line 421 } } }

PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on **line 224**

Code:

public function store($data, $id, $group = null) { $locktest = new stdClass; $locktest-&gt;locked = null; $locktest-&gt;locklooped = null; $locktest = $this-&gt;cache-&gt;lock($id, $group); if ($locktest-&gt;locked == false &amp;&amp; $locktest-&gt;locklooped == true) { $locktest = $this-&gt;cache-&gt;lock($id, $group); } $sucess = $this-&gt;cache-&gt;store(serialize($data), $id, $group); // line 224 if ($locktest-&gt;locked == true) { $this-&gt;cache-&gt;unlock($id, $group); } return $sucess; }

Last edit: 14 years 5 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

14 years 5 months ago [\#50918](#50918) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50918 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

You have a currency with a rate of 0 on your website. That should not be possible. Please check your currency rates.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

14 years 5 months ago -  14 years 5 months ago [\#50924](#50924) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50924 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

j'ai laisse 2 currency et supprime tout le reste
l'euro est actif et currency_rate = 1
le dollars est inactif et currency_rate = 1

Last edit: 14 years 5 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

14 years 5 months ago [\#50925](#50925) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50925 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

Vous avez une monnaie avec un taux à 0 sur votre site. Ca n'est pas possible. Veuillez vérifier vos monnaies.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

14 years 5 months ago [\#50928](#50928) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50928 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

[ ![Capturedecran2012-05-21a17.48.07.jpg](/forum/attachment/3907) ](/forum/attachment/3907 "...1a17.48.07.jpg")

- [ ![Capturedecran2012-05-21a17.48.07.jpg](/forum/attachment/3907) ](/forum/attachment/3907 "...1a17.48.07.jpg") [ ](/forum/attachment/3907?download=1 "...1a17.48.07.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

14 years 5 months ago [\#50931](#50931) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50931 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

Alors vous avez un coupon/une réduction configuré avec une des monnaies que vous avez supprimé.

Sachez que cela ne sert à rien de supprimer les monnaies. Elles seront réinstallées automatiquement lors de la prochaine mise à jour.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

14 years 5 months ago [\#50937](#50937) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#50937 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

non tous les coupons ont étés fait après et la seule monnaie active est l'euro

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

14 years 5 months ago [\#51067](#51067) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#51067 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

Rajoutez le code:
if($srcCurrency-&gt;currency_rate&gt;0)

devant:
$coupon-&gt;discount_flat_amount=(floatval($coupon-&gt;discount_flat_amount)/floatval($srcCurrency-&gt;currency_rate));

et cela corrigera le problème.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

14 years 5 months ago [\#51172](#51172) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: Division by zero and Out of memory](/forum/3-bug-report/50814-division-by-zero-and-out-of-memory#51172 "I am getting these errors  PHP Warning: Division by zero in ./administrator/components/com&#95;hikashop/classes/currency.php on line 1077  PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 82 bytes) in ./libraries/joomla/registry/registry.php on line 421 PHP Fatal error: Out of memory (allocated 1310720) (tried to allocate 11243 bytes) ./libraries/joomla/cache/controller.php on line 224")*

oui merci

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDgxNC1kaXZpc2lvbi1ieS16ZXJvLWFuZC1vdXQtb2YtbWVtb3J5P3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.153 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
