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

#   500 Internal Server Error downloading large files

##

- **[Fliegel](/forum/user/32173-fliegel "View Fliegel's Profile")**
- [![Fliegel's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32173.jpg)](/forum/user/32173-fliegel "View Fliegel's Profile") Topic Author
- [ Offline](/forum/user/32173-fliegel)

Less More

- Posts: 7
- Thank you received: 0
-
-
-

11 years 5 months ago [\#202087](#202087) by [Fliegel](/forum/user/32173-fliegel "View Fliegel's Profile")  *[500 Internal Server Error downloading large files](/forum/35-orders-management/877028-500-internal-server-error-downloading-large-files#202087 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.24 -- Browser(s) name and version -- : Chrome, IE, FF  Hey, sorry if i posted this in the wrong category but i found no suitable forum section for questions regarding the digital download options of hikashop.  On our website we want to sell several digital files from MP3s to videos in various resolutions/formats. I created a first test file and product (a ~500MB ZIP file with some WAVs) and everything seems to workf fine.  i then created another product which consists of 4 different video/data files and while my customer was able to download both the 2MB PDF and a 1.35GB MP4 video he (and myself as well) got a 500 Internal Server Error when trying to download the other 2 files: a ~4,4 GB ISO and a 2,9GB WMV.  First i thought this issue is related to the PHP &quot;max&#95;execution&#95;time&quot; (which is set to 50000 by default from our hosting company) but since it took me ~90 secs to download the 500MB test file without any issues (and the client managed to download the even bigger 1.3GB file) i wonder if there is another file size issue maybe with the PHP handling the download?  Thanks Robert")* was created by *[Fliegel](/forum/user/32173-fliegel "View Fliegel's Profile")*

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.5.24
-- Browser(s) name and version -- : Chrome, IE, FF

Hey, sorry if i posted this in the wrong category but i found no suitable forum section for questions regarding the digital download options of hikashop.

On our website we want to sell several digital files from MP3s to videos in various resolutions/formats.
I created a first test file and product (a ~500MB ZIP file with some WAVs) and everything seems to workf fine.

i then created another product which consists of 4 different video/data files and while my customer was able to download both the 2MB PDF and a 1.35GB MP4 video he (and myself as well) got a 500 Internal Server Error when trying to download the other 2 files: a ~4,4 GB ISO and a 2,9GB WMV.

First i thought this issue is related to the PHP "max_execution_time" (which is set to 50000 by default from our hosting company) but since it took me ~90 secs to download the 500MB test file without any issues (and the client managed to download the even bigger 1.3GB file) i wonder if there is another file size issue maybe with the PHP handling the download?

Thanks
Robert

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 5 months ago [\#202110](#202110) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[500 Internal Server Error downloading large files](/forum/35-orders-management/877028-500-internal-server-error-downloading-large-files#202110 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.24 -- Browser(s) name and version -- : Chrome, IE, FF  Hey, sorry if i posted this in the wrong category but i found no suitable forum section for questions regarding the digital download options of hikashop.  On our website we want to sell several digital files from MP3s to videos in various resolutions/formats. I created a first test file and product (a ~500MB ZIP file with some WAVs) and everything seems to workf fine.  i then created another product which consists of 4 different video/data files and while my customer was able to download both the 2MB PDF and a 1.35GB MP4 video he (and myself as well) got a 500 Internal Server Error when trying to download the other 2 files: a ~4,4 GB ISO and a 2,9GB WMV.  First i thought this issue is related to the PHP &quot;max&#95;execution&#95;time&quot; (which is set to 50000 by default from our hosting company) but since it took me ~90 secs to download the 500MB test file without any issues (and the client managed to download the even bigger 1.3GB file) i wonder if there is another file size issue maybe with the PHP handling the download?  Thanks Robert")*

Hi,

Yes, PHP might not be the most appropriate to send large file.
For example, HikaShop is using "filesize" (like Joomla).
[ php.net/manual/en/function.filesize.php](http://php.net/manual/en/function.filesize.php)

> **Note:** Because PHP's integer type is signed and many platforms use 32bit integers, some filesystem functions may return unexpected results for files which are larger than 2GB.

So if you have a "500 Internarl Server Error" ; you should be able to see more details in your server log (and your PHP error log).
I suspect that some other functions in PHP for files are not perfect for large files (&gt; 2GB)

I will recommend you to use the x-send-file method.
It will be less CPU/Memory consuming and it will be easier for the server to handle the large files.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[Fliegel](/forum/user/32173-fliegel "View Fliegel's Profile")**
- [![Fliegel's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32173.jpg)](/forum/user/32173-fliegel "View Fliegel's Profile") Topic Author
- [ Offline](/forum/user/32173-fliegel)

Less More

- Posts: 7
- Thank you received: 0
-
-
-

11 years 5 months ago [\#202156](#202156) by [Fliegel](/forum/user/32173-fliegel "View Fliegel's Profile")  Replied by *[Fliegel](/forum/user/32173-fliegel "View Fliegel's Profile")* on topic *[500 Internal Server Error downloading large files](/forum/35-orders-management/877028-500-internal-server-error-downloading-large-files#202156 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.24 -- Browser(s) name and version -- : Chrome, IE, FF  Hey, sorry if i posted this in the wrong category but i found no suitable forum section for questions regarding the digital download options of hikashop.  On our website we want to sell several digital files from MP3s to videos in various resolutions/formats. I created a first test file and product (a ~500MB ZIP file with some WAVs) and everything seems to workf fine.  i then created another product which consists of 4 different video/data files and while my customer was able to download both the 2MB PDF and a 1.35GB MP4 video he (and myself as well) got a 500 Internal Server Error when trying to download the other 2 files: a ~4,4 GB ISO and a 2,9GB WMV.  First i thought this issue is related to the PHP &quot;max&#95;execution&#95;time&quot; (which is set to 50000 by default from our hosting company) but since it took me ~90 secs to download the 500MB test file without any issues (and the client managed to download the even bigger 1.3GB file) i wonder if there is another file size issue maybe with the PHP handling the download?  Thanks Robert")*

Hi Jerome, thank you for your fast response.

As i understand correctly, using x-send requires me to modify both the Apache webserver and as well the PHP script of hikashop that handles the file (as mentioned here for example [ www.jasny.net/articles/how-i-php-x-sendfile/](http://www.jasny.net/articles/how-i-php-x-sendfile/) )?

best regards
Robert

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 5 months ago [\#202161](#202161) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[500 Internal Server Error downloading large files](/forum/35-orders-management/877028-500-internal-server-error-downloading-large-files#202161 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.5.24 -- Browser(s) name and version -- : Chrome, IE, FF  Hey, sorry if i posted this in the wrong category but i found no suitable forum section for questions regarding the digital download options of hikashop.  On our website we want to sell several digital files from MP3s to videos in various resolutions/formats. I created a first test file and product (a ~500MB ZIP file with some WAVs) and everything seems to workf fine.  i then created another product which consists of 4 different video/data files and while my customer was able to download both the 2MB PDF and a 1.35GB MP4 video he (and myself as well) got a 500 Internal Server Error when trying to download the other 2 files: a ~4,4 GB ISO and a 2,9GB WMV.  First i thought this issue is related to the PHP &quot;max&#95;execution&#95;time&quot; (which is set to 50000 by default from our hosting company) but since it took me ~90 secs to download the 500MB test file without any issues (and the client managed to download the even bigger 1.3GB file) i wonder if there is another file size issue maybe with the PHP handling the download?  Thanks Robert")*

Hi,

You do not need to modify HikaShop to use "x-send".
We have already some code in the HikaShop class File which look at the apache modules and use "x-send" if the module "mod_xsendfile" is found.

So you just have to add/activate the module in apache.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [Fliegel](/forum/user/32173-fliegel "View Fliegel's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg3NzAyOC01MDAtaW50ZXJuYWwtc2VydmVyLWVycm9yLWRvd25sb2FkaW5nLWxhcmdlLWZpbGVzP3RtcGw9bWFya2Rvd24=) 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.170 seconds

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

[](#top)
