This is really unnecessary. You can find out on behalf of which user, your web server is running by running this single line of php code:
$ chmod -R 777 tmp
$ chmod -R 777 data
In my case, i got 'daemon' as the user on behalf of which the webserver is running.
Now we need to change the ownership of the data or tmp directory and make 'daemon' as the owner.
$chown -R daemon tmp