Thank you for your reply canajun2eh.
Yes, I did set chmod 777 for the /tmp directory. sudo chmod 777 /var/www/piwik/tmp. I had done this with the initial configuration during the installation itself. But that doesn't seem to work. I re-checked again right now; it gives the output : drwxrwxrwx 8 www-data www-data 4096 Nov 13 17:00 /var/www/piwik/tmp. I believe that is the required permissions. But it still doesn't work. :(
Yes, I did set chmod 777 for the /tmp directory. sudo chmod 777 /var/www/piwik/tmp. I had done this with the initial configuration during the installation itself. But that doesn't seem to work. I re-checked again right now; it gives the output : drwxrwxrwx 8 www-data www-data 4096 Nov 13 17:00 /var/www/piwik/tmp. I believe that is the required permissions. But it still doesn't work. :(