2013-01-11 76 views
0

我想使用jquery文件上传部件。我已将演示代码复制到我的网站。当它运行时,我得到以下错误(根据萤火虫):jquery文件上传部件

“NetworkError:500内部服务器错误 - http://24.xxx.xxx.xxx/server/php/

文件我要上传被丢到文件/目录没有问题。 httpd错误日志没有列出任何错误。如果我直接从浏览器运行server/php/index.php,我会看到格式正确的JSON字符串。

我已将所有网址更改为指向我的网站,而不是jqueryupload.appoint.com。

任何指导,将不胜感激。我正在运行Linux,Apache 2.4,PHP 5.4.10。

POST数据是:

-----------------------------314262861723757 Content-Disposition: form-data; name="files[]"; filename="004.JPG" Content-Type: image/jpeg ÿØÿà�JFIF��H�H��ÿá&.Exif��MM�*������� 

(lots of this) 

$óîxÕéº4kq¡ÞÚj7¯i34à)13�Çn{ó^}­@·öåå[k+÷@Úã`ÿ�­MNYEÁSGÿÙ -----------------------------314262861723757-- 

在index.php代码:

<?php 
/* 
* jQuery File Upload Plugin PHP Example 5.14 
* https://github.com/blueimp/jQuery-File-Upload 
* 
* Copyright 2010, Sebastian Tschan 
* https://blueimp.net 
* 
* Licensed under the MIT license: 
* http://www.opensource.org/licenses/MIT 
*/ 
error_reporting(E_ALL | E_STRICT); 
require('UploadHandler.php'); 
$upload_handler = new UploadHandler(); 

Uploadhandler.php是在演示提供的原始未修改这可以在这里找到:https://github.com/blueimp/jQuery-File-Upload#download

编辑:其他信息。 我可以毫无问题地上传非图片文件。只有在上传图像文件时才会出现问题。/server/php/thumbnails目录具有读写权限,并由守护进程用户拥有。我在代码中看到file.thumbnail_url的引用,但没有在哪里可以看到在index.html程序或支持JavaScript程序中定义的变量。

+0

看一看服务器日志,找出究竟是什么错误是什么。 –

+0

我按照上面提到的做了。错误日志中没有任何内容。 access_log文件只显示:“POST/server/php/HTTP/1.1”500 - – mlewis54

+0

正如您使用的是Firebug ... POST请求是什么样的,它由widget执行?那里有什么奇怪的东西?在我看来,服务器并不喜欢小部件与之交谈的方式。 –

回答

-2

您需要的GD库:

apt-get install php-gd