Site icon David Yin's Blog

Upload file with socket enabled

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.

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.


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.

Exit mobile version