I'm trying to create an upload script on a Win 2012 Server running IIS 8 and PHP 5.6. We can't get the PHP error logs running which is a big downer because it's hampering our ability to troubleshoot, so I figured I ask if anyone that has experience with PHP on a Windows server that might be able to help out.
I'm no fan of running PHP on IIS, but I have no choice in this case so please no flames there. We developed on a LAMP stack because we didn't have a WIMP stack available, when we tried to migrate we had much success but the upload script failed so I'm going to post the pertinent parts here and if anyone can lend a hand that would be awesome.
If I'm an idiot, moron, etc. I apologize.
// File Variables
$_FILES["image"]["name"] = date("Y-m-d-H-i-s").
'.png';
$filename = $_FILES["image"]["name"];
//Path Variables
$target_dir = "../uploads/";
$target_path = $target_dir.$_FILES["image"]["name"];
// Upload
if (move_uploaded_file($_FILES['image']['tmp_name'], $target_path)) {
$actual_link = "http://".$_SERVER[HTTP_HOST].
"/uploads/".$filename;
$myMessage. = '<br/><img src="'.$actual_link.
'" width="300" height="224" /><br/>';
}
I appreciate any assistance or guidance. Thanks!