Uploading or updating files on WordPress needs permission to read and write on the directory.
This is how you can modify and change the ownership of the directory to the apache user.
In this case my WordPress install on debian LAMP and we will run the command on terminal.

sudo chown -R www-data:www-data /path/of/wordpress

Don't forget to give update file permission by

sudo chmod -R 640 /path/of/wordpress

Use the value of 640 to make the owner of the file read and write. Avoid the 777 permission where it allows anyone to access your files.