在GAE上使用php55上传文件时出现问题。我有一个工作项目,我搬到了一个新的地区。但是,新项目,每次我提交文件上传,我得到:错误:服务器错误//服务器遇到错误,无法完成您的请求。 //请在30秒后再试一次
日志显示:
POST /programs/document_upload.php HTTP/1.1" 500 - - "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0" "[removed by me].appspot.com" ms=71 cpu_ms=0 cpm_usd=0 loading_request=0 instance=00c61b117ce8c499c97d89f7cb939b5bef3572160133de2db952aa263e080a86878f5c24be90b6 app_engine_release=1.9.54 trace_id=-
和
A problem was encountered with the process that handled this request, causing it to exit. This is likely to cause a new process to be used for the next request to your application. (Error code 204)
php文件加载正常,然后发布到自己上传文件,这是它死亡的地方。这是相关的代码:
<HTML><HEAD>
<?php
if(isset($_FILES["file"]))
{
if(is_array($_FILES['file']['name']))
{
for($i=0;$i<count($_FILES['file']['name']);$i++)
{
if($_FILES['file']['size'][$i]==0) continue;
$_FILES['file']['name'][$i]=str_replace('.jpeg','.jpg',$_FILES['file']['name'][$i]); // convert file extension name of jpeg to jpg
move_uploaded_file($_FILES['file']['tmp_name'][$i],"gs://[removed by me].appspot.com/pmd-scans/".$_FILES['file']['name'][$i]);
}
}
}
?>
</HEAD>
<BODY>
<FORM name=form method=POST enctype="multipart/form-data">
<INPUT type=file name='file[]' multiple accept='image/jpg'> <INPUT type=submit value='Upload'>
</BODY></HTML>
app.yaml有:
version: 4
runtime: php55
api_version: 1
该文件夹存在于云存储中。在GAE中是否有一些设置我忘记启用php文件上传?