PHP file upload error tmp_name is empty

I just check the max size in phpinfo();

Then check if php.ini is loaded

$inipath = php_ini_loaded_file();

if ($inipath) {
    echo 'Loaded php.ini: ' . $inipath;
} else {
   echo 'A php.ini file is not loaded';
}

Then Change the upload_max_filesize=2M to 8M

; Maximum allowed size for uploaded files.
upload_max_filesize = 8M 

; Must be greater than or equal to upload_max_filesize
post_max_size = 8M 

Finally reset your Apache Server to apply the changes

service apache2 restart

Leave a Comment