Doesn't work on my linux !

See all posts Reply

Doesn't work on my linux ! new!
by lovighi, 11 years, 9 months ago
Hello,

I got a big problem on my debian server. class.upload doesn't work.

I got same code on my local windows and no problem, my code isnt wrong but when i push my sources on the server (on linux), i can't upload anything.

I've check :
- php.ini (gd2 ok, memory_limit 128M,upload_max_filesize = 202M,post_max_size = 202M,max_execution_time = 60)
- permissions on folders
- tmp is writable
- i got gd 2 activate,

I try to get some infomation with $foo->log and i have :

system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.3.10-1ubuntu3.2
- GD version : 2.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 202M (211812352 bytes)
- language : en_GB
source is an uploaded file


source is an uploaded file is empty.

I dont know how to solve this problem...Reply
Re: Doesn't work on my linux ! new!
by lovighi, 11 years, 9 months ago
I try again with this sample, it don't work...

include 'class.upload.php';

if (isset($_POST['ajouter_sponsor'])) {

  $foo = new Upload($_FILES['image_sponsor']);
  if ($foo->uploaded) {
    // save uploaded image with no changes
    $foo->Process('js');
    if ($foo->processed) {
      echo 'original image copied';
    } else {
      echo 'error : ' . $foo->error;
    }
    // save uploaded image with a new name
    $foo->file_new_name_body = 'foo';
    $foo->Process('js');
    if ($foo->processed) {
      echo 'image renamed "foo" copied';
    } else {
      echo 'error : ' . $foo->error;
    }
    // save uploaded image with a new name,
    // resized to 100px wide
    $foo->file_new_name_body = 'image_resized';
    $foo->image_resize = true;
    $foo->image_convert = gif;
    $foo->image_x = 100;
    $foo->image_ratio_y = true;
    $foo->Process('js');
    if ($foo->processed) {
      echo 'image renamed, resized x=100
      and converted to GIF';
      $foo->Clean();
    } else {
      echo 'error : ' . $foo->error;
    }
  }
}

<form action="" enctype="multipart/form-data" method="post" >
<label>Choisir une image</label>
<input type="file" name="image_sponsor">
<button type="submit" name="ajouter_sponsor">Ajouter</button>
</form>

Reply
Re: Doesn't work on my linux ! new!
by colin, 11 years, 9 months ago
What does the complete log say? Do you have errors in Apache (or your webserver)?Reply
Re: Doesn't work on my linux ! new!
by lovighi, 11 years, 9 months ago
Apache didnt say anything about this, nothing happen, no errors in apache, no errors in my browser.

All my other php errors are displayed...really dont know what happenReply
Re: Doesn't work on my linux ! new!
by colin, 11 years, 9 months ago
Copy here the complete log produced by the class. ry with a small image file, to be sure that the memory is not an issue.

I develop the class on Debian, so it must work.Reply
Re: Doesn't work on my linux ! new!
by lovighi, 11 years, 9 months ago
yes, the class worked on my other deb install...

Told you, i gave all my logs, apache didnt say anything about it, just an error with my favicon.ico

I just have this :

system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.3.10-1ubuntu3.2
- GD version : 2.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 202M (211812352 bytes)
- language : en_GB
source is an uploaded fileReply
Re: Doesn't work on my linux ! new!
by lovighi, 11 years, 9 months ago
generated by $foo->log;Reply
Re: Doesn't work on my linux ! new!
by colin, 11 years, 9 months ago
Do you have anything in $foo->error?Reply
Re: Doesn't work on my linux ! new!
by lovighi, 11 years, 9 months ago
nothing, i didn't have any return.

$foo->error seems to be not interpretedReply
Re: Doesn't work on my linux ! new!
by lovighi, 11 years, 9 months ago
Missing apache or php module ?Reply
Re: Doesn't work on my linux ! new!
by lovighi, 11 years, 9 months ago
Did you have any idea or adviceReply
Re: Doesn't work on my linux ! new!
by colin, 11 years, 9 months ago
Well, without an error message from the class or from the web server, it is hard to find out...Reply