You are referencing a variable that was not assigned/created.
You are referencing an index of an array that was does not exist.
From what I can only speculate, the image isn’t being uploaded. Assuming that you didn’t check to make sure an image was actually uploaded and is moved to the /tmp directory.
The very first thing before trying to use the error_log function is to do a print_r($_FILES)
This way, I can see what is going through to the $_FILES variable. If the name or any of the indexes are empty, that means that those images some how aren’t being sent to the /tmp directory. In which case, that also means that there’s something wrong with your server configurations or Apache/ Nginx doesn’t have permissions to move temporary files to /tmp.
Oh right. The upload size could be the issue. The tmp folder doesn’t necessarily need to be modified, but making sure that Apache or Nginx can reach it.
Change the upload_max_filesize to 128M and the post_max_size to 128M as well.
if (empty($_POST["my_image"])) { /* If input is empty .*/
$imageErr = "Image is required."; /* Set error message.*/
$ok = false; /* Data not ready. */
}
Code from above gives me this error in apache log…
[Sun Mar 11 23:37:05.465389 2018] [:error] [pid 7769] [client ::1:35902] PHP Warning: move_uploaded_file(/img/user_upl/home_icon_android.png): failed to open stream: No such file or directory in /var/www/part/upload.php on line 39, referer: http://localhost/part/test.html
[Sun Mar 11 23:37:05.465432 2018] [:error] [pid 7769] [client ::1:35902] PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpMkUHHd' to '/img/user_upl/home_icon_android.png' in /var/www/part/upload.php on line 39, referer: http://localhost/part/test.html