尝试在Linux Mint LAMP服务器上上载文件会导致错误500

I am attempting upload a file using html/php and when I send a post request with the file, I get a 500 Internal Server Error. This only happens when I have the php code move_uploaded_files($_FILES['filetoUpload']['tmp_name'], $target_file); I have checked the php.ini file to confirm file_uploads' = On and I have confirmed that the permissions of the directory allow creating files. When I do a print_r($_FILES) I successfully see the array with all the file information. For some reason, when I try to save the file with the move_uploaded files function, the file doesn't upload and I get a internal error 500 come back.