This might be easy but I wasn't how to chmod a direcotry in php. I assumed it would be pass the path to the function like
chmod("upload/images/", 0777)
or something.
that is correct. except that is an invalid path.
chmod("/upload/images", 0777)