This is to note that the username for LAMPP process for MySQL and Apache is nobody. It is different than the default username for apache process which is www-data. To easily granted access for the web server apps, just change the owner of the accessed directory to nobody by using below code:

sudo chown nobody <path-to-folder>