I am trying to have file uploading with PHP 7.3 FPM and Nginx but it is not working. What is weird is that on my localhost this works (as long as I change the file upload path and that sort of thing). My phpinfo()
says that file uploads are on. My index.php is
<html>
<body>
<form action = "upload.php" method="POST" enctype="mutipart/form-data">
<input type="file" name="file">
<button type="submit" name="submit">Upload</button>
</body>
</html>
The directory it is in is /var/www/html/ and then my upload directory is /var/www/html/uploads/ my upload.php is
<?php
if (isset($_POST["submit"])) {
$file = $_FILES["file"];
$fileName = $_FILES["file"]["name"];
$upload_folder = "/var/www/html/uploads/";
move_uploaded_file($_FILES["file"]["tmp_name"], $upload_folder.$_FILES["file"]["name"]);
}
When I put in echo print_r($file)
it returns 1. Any idea what is going wrong?