I have a website, which allow user to upload large file. Such as 200MB flv file through WEB interface. This kind of upload is not use FTP, not the regular php upload function, or get, post form function. The large file has to use socket to upload.
It need socket enabled on PHP.
I do have the –enable-sockets configuration on PHP.
enable-socket-php

The problem is happened when I upload the big file, it is always stopped or died on certain parts. About 4MB size.
I think it must be time out of php script.
Later I found a directive called
default_socket_timeout
The default value is 60. It means 60 seconds.


default-socket-timeout

Do the rough calculation, the upload speed is about 4MB/minute. So 200MB is about 50 minutes. I change the default_socket_timeout value to 3000 in php.ini
Then, restart Apache and done.
I tried to upload the file which is 34MB. I was waiting about 10 minutes, the upload completed.

David Yin

David is a blogger, geek, and web developer — founder of FreeInOutBoard.com. If you like his post, you can say thank you here

2 Replies to “Upload file with socket enabled

Leave a Reply

Your email address will not be published. Required fields are marked *