Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PHP Upload Issues
This wiki page explains how to modify
.htaccessfile to support large-size uploads in PHP applications. Such issues usually happens when you try to record 2-3 minutes of audio/video streams and resulting Blobs size gets bigger/larger than 10MB.
It is a common case among all PHP default installations. You should define following values in
.htaccess file if you've root-level privileges.
<IfModule mod_php4.c> php_value session.gc_maxlifetime 10800 php_value max_input_time 10800 php_value max_execution_time 10800 php_value upload_max_filesize 500M php_value post_max_size 500M </IfModule>
Above technique rarely works on Amazon EC2. You need to login as root-user to the terminal; then search for all
find /etc/ -name "php.ini"
There should be
php.ini file located in your appache installation directory. Its location varies for each installation that's why you should check all
vim php.ini // or otherwise you can use "vi" vi php.ini
Above command will open editing mode; then you should search and edit following values:
/session.gc_maxlifetime /max_input_time /max_execution_time /upload_max_filesize /post_max_size
Each line is searching a specific string. Note: Above command may work in
replace mode instead of
You should change default values to:
session.gc_maxlifetime=10800 max_input_time=10800 max_execution_time=10800 upload_max_filesize=500M post_max_size=500M
Remember, NEVER forget "max_execution_time" because usually ffmpeg execution process takes time to transcode and merge webm.
:wq command can be used to save changes and close editing mode. You need to type this command in "replace" mode.
Note: You can navigate between
replace modes by simply pressing
You MUST restart/reboot appache server to make sure new changes are applied.
Please don't forget to set a temporary PHP page where you can check PHP-info:
<?php // Show all information, defaults to INFO_ALL phpinfo(); ?>
Now, open that PHP page and search for all above values e.g.
[sudo] chmod 755 ./uploads [sudo] chown -R www-data:www-data ./uploads [sudo] chown -R apache:apache ./uploads
P.S. Sometimes you need to manually set read/write access for directories like "uploads" however your demo has privileges to read/write WAV/WebM files in uploads directory.