Failed to upload image on localhost

It turns out the permission settings are fine. I just needed to restart the Apache server. This problem had nothing to do with the modification of the httpd.conf file.