简单Ajax上传程序PHP代码不返回任何响应
我尝试使用简单的Ajax上传程序,但它提供了以下输出:简单Ajax上传程序PHP代码不返回任何响应,php,jquery,ajax,Php,Jquery,Ajax,我尝试使用简单的Ajax上传程序,但它提供了以下输出: GET <URL> net::ERR_EMPTY_RESPONSE GET net::ERR\u EMPTY\u响应 我不确定我做错了什么 我的php代码: <?php require('Uploader.php'); // Directory where we're storing uploaded images // Remember to set correct permissions or it w
GET <URL> net::ERR_EMPTY_RESPONSE
GET net::ERR\u EMPTY\u响应
我不确定我做错了什么
我的php代码:
<?php
require('Uploader.php');
// Directory where we're storing uploaded images
// Remember to set correct permissions or it won't work
$upload_dir = '/uploads/';
echo "reached";
$uploader = new FileUpload('uploadfile');
// Handle the upload
$result = $uploader->handleUpload($upload_dir);
if (!$result) {
exit (json_encode(array('success' => false, 'msg' => $uploader->getErrorMsg())));
}
echo json_encode(array('success' => true, 'file' => $uploader->getFileName()));
?>
可以找到Uploader.php:问题在于我使用的Web服务器,它无法调用/执行php脚本 打开开发者的控制台,看看那里发生了什么。我没有看到那里发生了什么