The following is the code for uploading files, but when I upload web script languages such as php, asp, jsp, a 500 error occurs, and other suffix files are normal
But When I use phpstudy2016, the upload is normal. I feel that it may be a problem with the apache configuration file
So I would like to ask if anyone has encountered similar problems and can you come out to discuss it
sqlin.php
0) { echo "错误:: " . $_FILES["scfile"]["error"] . "
"; } else { echo "上传文件名: " . $_FILES["scfile"]["name"] . "
"; echo "文件类型: " . $_FILES["scfile"]["type"] . "
"; echo "文件大小: " . ($_FILES["scfile"]["size"] / 1024) . " kB
"; echo "文件临时存储的位置: " . $_FILES["scfile"]["tmp_name"] . "
"; // 判断当期目录下的 upload 目录是否存在该文件 // 如果没有 upload 目录,你需要创建它,upload 目录权限为 777 if (file_exists("upload/" . $_FILES["scfile"]["name"])) { echo $_FILES["scfile"]["name"] . " 文件已经存在。 "; } else { // 如果 upload 目录不存在该文件则将文件上传到 upload 目录下 move_uploaded_file($_FILES["scfile"]["tmp_name"], "upload/" . $_FILES["scfile"]["name"]); echo "文件存储在: " . "upload/" . $_FILES["scfile"]["name"]; } } } else { echo "非法的文件格式"; } ?>
Look at the file upload configuration in your php.ini file. There are some upload file configurations around line 800