Amazon Elastic Transcoder Fails With Files Larger than 100mb - php

I have a social media website, and I think it will attract a lot of visitors. It allows users to upload images and video. For video, it uploads with PHP then converts it to the right format using Elastic Transcoder. It then stores the files into S3 Buckets. When I upload small videos (less than around 80mb) it works fine. But if I upload like a 150 or 300mb file, the job fails. Can anyone tell me why it happens and how to fix this? I have been stuck on this for the past 2 months.

Could be a few issues;
Your PHP script is timing out, do you need to set a higher time out limit for that script?
Max POST size is too small, you may need to edit the PHP config to increase POST OR Memory limits.
Also you should check the PHP and Apache logs to see if anything odd is occurring.

Related

Upload big files in php

I need to upload big files from my website (music albums). The problem is that I can't upgrade my server speed and usually for those big files connection goes down (too much time for response, timeout). I could change php.ini stats but usually music albums need 5-10 min for upload. Which simple solution can you suggest me?

Optimize Wordpress image upload, slow and only 1 at a time on Dedicated

So I have been at this for weeks with different configurations and I usually am able to figure out by searching but I am not as savvy with server configuration, so I need to ask. Hopefully someone can point me in the right direction.
I have a dedicated server with 5 different WordPress installation, EVERYTHING is blazing fast, in terms of site load speed and posting, etc EXCEPT for when I start uploading images using the Wordpress Image upload. ITS SLOW..
When I drag photos over (doesn't matter the size) it takes forever and it seems to be processing one image at a time, unlike when I was on shared hosting, the image upload was a lot faster.. This happens on all my Wordpress installation with different themes and plugins, so I assume this is a server configuration, somewhere.
The process bar would go to 99% for the first image and it sits there for a few minutes, and then goes to the next; also my Admin would stall, so I cannot do anything else on the Admin area until all the images are done uploading. The site doesn't stall and is still functional if I go on a different browser that isn't login as the Admin.
If I go to my process manager, I see that the async-upload.php is running and is only taking up .3% of the CPU and .6% of the memory.
It always finishes but it seems like I am only allowed to have 1 connection or process (sorry, I do not know the correct terms) at a time and then I can request another. Anyone know what server configuration I am missing or have that is causing this? I am on WHM/Cpanel with SSH access, I have tried a few PHP, MySql, and Apache optimizations I found but it hasn't resolved the problem, I am of course doing something wrong with my configuration, anyone can shed some light?
Near the end of its image upload operation, WordPress attempts to resize the incoming images to create thumbnails and medium-sized images. To do this it has to load the images, decompressed, into memory.
That can take a lot of RAM. Try increasing the RAM available to your php instance. Look, in php.ini for a stanza like this
; Maximum amount of memory a script may consume
; http://php.net/memory-limit
memory_limit = 32M
and increase it.
You may also have issues with these settings.
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 8M
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
Also, take a look in your php_error.log and apache_error.log files and see if you can see any problems. Also, if you're using Google Chrome, open the Javascript console and see if there are any errors showing up.

Can I download a resized image?

I have a cron process that gathers information about movies and presents finished information to the user. Periodically, however, the link provided by the API to the "movie poster" is massive, and it's crashing the process with memory issues.
As an example - this file http://content8.flixster.com/movie/11/16/86/11168662_ori.jpg is huge. I believe it's around 17MB, and the image itself clocks in at 8175px x 12075px.
The maximum size my end users will see is around 360px wide. So downloading such a massive image is kind of ridiculous. And the next size down is 180 x 266 - I'm worried that it might not look right if I scale it up.
Is there a way that PHP will allow me to download a resized version? I know that if I download the file, I can do a million things to it. I'm trying to change the size of the download itself.
If not - any other solutions anyone can think of?
Unfortunately there is no way and there cannot be a way logically. However there is a workaround. You can take help of some online utility to do the job
e.g. http://quickthumbnail.com which generates the thumbnail from given url
Hope this works for you.
This has nothing to do with PHP. Some remote service offers a file. You can take it or leave it. If they don't offer some API to downloaded a different size or different version of the file, you can't get it.
All you can do is download the file to your server, resize it there and offer it to your users.

Looking for a flash uploader to upload large files

I need a flash uploader, to use it in my CMS project.
I need something like this, but with greater max upload size (it doesn't allow to upload files larger ini_get('upload_max_filesize')).
My server doesn't allow me to overwrite ini settings, so I'm looking for an uploader which can upload large files independently from the ini settings.
If you want to go around the ini limit, one option would be to change and use an FTP uploader.
I've used once net2ftp and it was easy enough in its installation; I've never used it again since (almost 1 year and a half), but I see from their page that the project is updated and not dead, so you might give it a try.
You just download the package, place it in your webapp, customize it, and you're set.
You might want to create a dedicated FTP user with appropriate permissions, and not use the root one, of course.
You wont be able to post more data to the server than the max_upload_size.
As a workaround you can upload the data to Amazon S3 and sync it back via s3sync.
We have a setup with plupload in place for one of our clients and are able to upload up to 2GB per file (that's a client restriction, I don't know about S3 restrictions)
Mind you that S3 costs some money.

How Amazon S3 provides unlimited storage space?

In order to maintain user uploaded images in website becomes very tough as the number of images are increasing. In the long run the available disk space will come to 0 bytes.
Amazon generally provides unlimited space for their S3 service. If we want to provide unlimited space to our website what are the possible ways?
Shard your servers that host the images. Once one fills up, add another. You'll have to write some custom code for uploading to know where the uploaded files are and when a server is almost full.
The only way I know of is to minimize all your files (eg index.php), and, when your website begins to make money, by another HDD. I think thats all Amazon does, anyway.

Categories