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

#   Memory allocation error

##

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

Less More

- Posts: 52
- Thank you received: 0
-
-

15 years 6 months ago -  15 years 6 months ago [\#14878](#14878) by [icronje](/forum/user/1483-icronje "View icronje's Profile")  *[Memory allocation error](/forum/2-general-talk-about-hikashop/14878-memory-allocation-error#14878 "I get the following error when trying to upload a product image for a product.  Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 17472 bytes) in /home/lesswhkd/public&#95;html/administrator/components/com&#95;hikashop/helpers/image.php on line 316  Can anyone assist?")* was created by *[icronje](/forum/user/1483-icronje "View icronje's Profile")*

I get the following error when trying to upload a product image for a product.

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 17472 bytes) in /home/lesswhkd/public_html/administrator/components/com_hikashop/helpers/image.php on line 316

Can anyone assist?

Last edit: 15 years 6 months ago by [icronje](/forum/user/1483-icronje "View icronje's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzE0ODc4LW1lbW9yeS1hbGxvY2F0aW9uLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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: 86358
- Thank you received: 14290
-
-

15 years 6 months ago [\#14888](#14888) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Memory allocation error](/forum/2-general-talk-about-hikashop/14878-memory-allocation-error#14888 "I get the following error when trying to upload a product image for a product.  Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 17472 bytes) in /home/lesswhkd/public&#95;html/administrator/components/com&#95;hikashop/helpers/image.php on line 316  Can anyone assist?")*

Hi,

That's because you're trying to upload images too big. You have several options:
1. reduce the size of your images before uploading them.
2. deactivate the thumbnail/watermark/image size options of the "files" tab of the config.
3. ask your hosting company to increase the memory_limit of your PHP settings.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzE0ODc4LW1lbW9yeS1hbGxvY2F0aW9uLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 40
- Thank you received: 0
-
-

14 years 10 months ago [\#32552](#32552) by [jlhosch](/forum/user/2985-jlhosch "View jlhosch's Profile")  Replied by *[jlhosch](/forum/user/2985-jlhosch "View jlhosch's Profile")* on topic *[Re: Memory allocation error](/forum/2-general-talk-about-hikashop/14878-memory-allocation-error#32552 "I get the following error when trying to upload a product image for a product.  Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 17472 bytes) in /home/lesswhkd/public&#95;html/administrator/components/com&#95;hikashop/helpers/image.php on line 316  Can anyone assist?")*

Bonjour Nicolas,

J'ai rencontré la même erreur que décrite dans ce post : sur un hébergement dont la limite mémoire dans le php.ini était de 128M (OVH), le chargement d'images de 4Mo passe nickel.
sur l'hébergement live de mon client, cette limite était fixée à 24M ==&gt; forcément, ça coince, mm sans watermark.

Pour que cela fonctionne, j'ai modifié le script /administrator/components/com_hikashop/helpers/image.php de la façon décrite ci-dessous ; est-ce suffisamment propre et correct ? y a-t'il un moyen de repositionner la valeur par défaut de manière générique ?
:
function scaleImage($x,$y,$cx,$cy) {
/* GG 20111213 allocation mem max spécifique */
ini_set("memory_limit","128M");
/* GG 20111213 fin allocation mem max spécifique */
if(empty($cx)){
$cx = 9999;
}
if(empty($cy)){
$cy = 9999;
}
if ($x&gt;=$cx &#124;&#124; $y&gt;=$cy) {
if ($x&gt;0) $rx=$cx/$x;
if ($y&gt;0) $ry=$cy/$y;
if ($rx&gt;$ry) {
$r=$ry;
} else {
$r=$rx;
}
$x=intval($x*$r);
$y=intval($y*$r);
return array($x,$y);
}
/* GG 20111213 repositionnement limite memoire */
ini_set("memory_limit","24M");
/* GG 20111213 fin repositionnement limite memoire */
return false;
}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzE0ODc4LW1lbW9yeS1hbGxvY2F0aW9uLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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: 86358
- Thank you received: 14290
-
-

14 years 10 months ago [\#32560](#32560) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Memory allocation error](/forum/2-general-talk-about-hikashop/14878-memory-allocation-error#32560 "I get the following error when trying to upload a product image for a product.  Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 17472 bytes) in /home/lesswhkd/public&#95;html/administrator/components/com&#95;hikashop/helpers/image.php on line 316  Can anyone assist?")*

Nous ne pouvons pas faire cela par défaut dans HikaShop car l'appel à ini_set sur certains hébergeurs peut faire crasher les pages (nous en avions auparavant et les avons supprimé justement à cause de cela).

Le mieux est d'avoir un php.ini configuré avec une limite mémoire suffisante.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzE0ODc4LW1lbW9yeS1hbGxvY2F0aW9uLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 40
- Thank you received: 0
-
-

14 years 10 months ago [\#32567](#32567) by [jlhosch](/forum/user/2985-jlhosch "View jlhosch's Profile")  Replied by *[jlhosch](/forum/user/2985-jlhosch "View jlhosch's Profile")* on topic *[Re: Memory allocation error](/forum/2-general-talk-about-hikashop/14878-memory-allocation-error#32567 "I get the following error when trying to upload a product image for a product.  Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 17472 bytes) in /home/lesswhkd/public&#95;html/administrator/components/com&#95;hikashop/helpers/image.php on line 316  Can anyone assist?")*

Merci de l'info. J'ai donc un turn around et je vais discutailler avec l'hébergeur ![;-)](/media/kunena/emoticons/24.png ";-)")

à bientôt

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzE0ODc4LW1lbW9yeS1hbGxvY2F0aW9uLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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.102 seconds

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