For Linux operating system you have to set the default apache user and group in its configuration file. That is apache2.conf
Steps
1. vim /etc/apache2/apache2.conf
2. set user and group to your machine account user and group
3. then save it
4. then restart apache (service apache2 restart)
For example
User vijay
Group vijay
0
solved php file upload not moving to target directory permission issue ubuntu apache