I am trying to upload a video using PHP 6.0, Ubuntu 14.04.5 LTS 32 bit, but I can not upload. Tmp_name is empty. All possible problems have been resolved.
In php.ini, I configured correctly:
Php_value upload_max_filesize
Php_value post_max_size
In function tmp_error The result was error 6.
Value: 6; Missing a temporary folder. Introduced in PHP 5.0.3.
Referred site: https://www.php.net/manual/en/features.file-upload.errors.php
Permissions granted on Linux:
Sudo chown -R www-data: www-data / tmp
Sudo chown -R www-data: www-data uploads
Sudo chmod 777 / tmp
Sudo chmod 777 uploads
Please someone could help me.
Solution to the problem:
1º Access the file /etc/php5/cli/php.ini
2º In php.ini find the lines that contains:
Memory_limit
Upload_max_filesize
Post_max_size
Change the default values, for example:
Memory_limit = 100M
Upload_max_filesize = 100M
Post_max_size = 100M
3º Find the line containing:
Upload_tmp_dir
Change the value to:
Upload_tmp_dir = /tmp
4th Change permissions
Sudo chown -R www-data:www-data /tmp Sudo chown -R www-data:www-data uploads
Sudo chmod 644 /tmp Sudo chmod 644 uploads
5º Repeat steps 1º through 4º in the file:
/etc/php5/apache2/php.ini
6th Restart Apache
If you are using Ubuntu or Debian Sudo /etc/init.d/apache2 restart
If you are using RedHat, Fedora or CentOS Service httpd restart
Thanks very much
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With