#1
  1. No one Important
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    524
    Rep Power
    18

    Warning: File upload error - unable to create a temporary file in Unknown on line 0


    hi there, got a problems with some uploads on OpenBSD 3.2, apache 1.3.26.....

    File uploads are not working..... I switched on the error messages and I get the following:-

    Warning: File upload error - unable to create a temporary file in Unknown on line 0

    Notice: Undefined index: userfile in /htdocs/query/thorny.php on line 19

    Notice: Undefined variable: userfile_type in /htdocs/query/thorny.php on line 20

    Notice: Undefined index: userfile in /htdocs/query/thorny.php on line 21

    I am sure once the first error is cleared up the others will not follow....

    apache has been set with user www and group www

    default tmp directory is /tmp as normal...

    can someone maybe offer some suggestions??
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    69
    Rep Power
    21
    How a bout a code snippet of the script?
    Try posting the lines where you manipulate the uploaded image...
    I always wanted to be somebody, guess I should have been more specific
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2002
    Posts
    679
    Rep Power
    22
    Ownership and permissions on /tmp ?? www must have write permissions on this directory - sorry if this is obvious and you checked it already!
  6. #4
  7. No one Important
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    524
    Rep Power
    18
    SiS:

    The code is not a problem as it was working on another remote server, that is why i did not post the code, cause it was already working, sorry for leaving that part out....

    pmm:

    What would be the best way to set the permissions for /tmp??

    Currently /tmp is root:wheel I added www to the group wheel but still nothing.............

    please help
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2002
    Posts
    679
    Rep Power
    22
    does the group have write permissions? try chmod 775 /tmp and see if that does it
  10. #6
  11. No one Important
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    524
    Rep Power
    18
    Hey there pmm,

    well after posting the message I still was on my search on the web for an answer, and found that with the package installation of apache on OpenBSD 3.2 it is compile with the CHRoot enabled.

    Which means when php and apache were running it was taking the /var/www as the actual computer root, rather than the normal /

    so I had to actually create a /tmp directory in /var/www and create the permissions there....

    This would have also create problems with my sessions once I started using them again because it was unable to create any files in a directory that does not exist.....

    But thanks for the time and effort anyways....
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    OpenBSD Land
    Posts
    21
    Rep Power
    0
    i thought /tmp was supposed to be chmod 1755 ?

    PHP Code:
    drwxrwxrwt    4 root  wheel     1024 Feb 17 12:12 tmp 
  14. #8
  15. No Profile Picture
    -------------------
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    200
    Rep Power
    18
    I added www to the group wheel but still nothing.............
    That was a very, very bad idea. You should immediately remove 'www' from the wheel group. Even if that had fixed the problem, it opens countless security holes. (having 'www' in the real root group defeats the whole purpose of chrooting apache...)
  16. #9
  17. No one Important
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    524
    Rep Power
    18
    I have removed www form the wheel group, however it does not really matter so much as the machine is local behind a network.......... the only time it sees the internet is via my network connection (ISC) through a firewall.

    But it is all sorted now with the /tmp directory created in the root of the apache chroot

    Cheers

IMN logo majestic logo threadwatch logo seochat tools logo