Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
简单Ajax上传程序PHP代码不返回任何响应_Php_Jquery_Ajax - Fatal编程技术网

简单Ajax上传程序PHP代码不返回任何响应

简单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

我尝试使用简单的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 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脚本

打开开发者的控制台,看看那里发生了什么。我没有看到那里发生了什么