Re: Crashing after instantiation

See all posts Reply

Re: Crashing after instantiation new!
by Tim, 10 years, 6 months ago
I'm having a very confusing problem; the script crashes right after instantiation. I'm working with a very small jpg (33k) to make sure it isn't a memory issue. Nothing is being reported in the error logs either. So I created a simple testupload.php script to see if there's a permissions issue, etc. and THAT works.

I've removed the upload and security checks from the code below to just show the relevant parts.

// this doesn't work
$handle = new Upload($_FILES['photo']);
if($handle->uploaded) {
  $handle->file_new_name_body = $hash;
  $handle->file_overwrite = true;
  $handle->image_resize 	= false;
  $handle->process('/srv/wt/htdocs/admin/uploadtest/');
  if($handle->processed) {
    $handle->clean();
  } else {
    $form->add_to_errors($handle->error);
  }
  $photo = $hash.'.'.$handle->file_src_name_ext;
}

// but this does
move_uploaded_file($_FILES["photo"]["tmp_name"],"/srv/wt/htdocs/admin/uploadtest/" . $_FILES["photo"]["name"]);
Reply
Re: Crashing after instantiation new!
by colin, 10 years, 6 months ago
Check in your web server's log.Reply
Re: Crashing after instantiation new!
by Tim, 10 years, 6 months ago
Nothing is being reported in the logs.Reply
Re: Crashing after instantiation new!
by colin, 10 years, 6 months ago
If there is a crash of the page, there should be something in the web server's log. or maybe the server itself crashes?Reply