Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

images not uploading [php]

Options
  • 23-06-2010 11:08am
    #1
    Registered Users Posts: 8,070 ✭✭✭


    UPLOAD TEMP DIR not FOUND

    theres no temp dir specified when i run phpinfo either.
    This is a custom script, site also runs wordpress, which fails to upload now.

    this just happened suddenly, so i thought maybe it would be a server/hosting issue. So i asked them to have a look and they asked where my wp-content folder was :rolleyes:

    its not a folder permission/chmod issue, i think php just cant find temp folder to upload to?

    i asked hosting to check the ini file and obviously shared hosting, they cant.
    "However you do have the ability to create a custom local php.ini file in your public_html folder."

    any ideas?
    thanks


Comments

  • Registered Users Posts: 6,509 ✭✭✭daymobrew


    What does sys_get_temp_dir() report? [PHP]<?php
    echo sys_get_temp_dir();
    ?>[/PHP]
    You can also use upload_tmp_dir setting in a local php.ini.


  • Registered Users Posts: 8,070 ✭✭✭Placebo


    how do i set local php.ini btw?


  • Registered Users Posts: 6,509 ✭✭✭daymobrew


    Placebo wrote: »
    how do i set local php.ini btw?
    Ask the hosting company because they say that you can do it:
    Placebo wrote: »
    "However you do have the ability to create a custom local php.ini file in your public_html folder."


  • Registered Users Posts: 8,070 ✭✭✭Placebo


    they said to just add php.ini in the public_html folder
    it only works i.e prints out the upload_tmp_dir when its in the same folder as the script anyway

    i put this in the ini file
    upload_tmp_dir = "/home/USER/tmp"
    also tried
    upload_tmp_dir = "/home/USER/public_html/tmp"


    but the first one is where the tmp folder was but i tried creating it else where with 777 permissions

    leave ini in same folder as the script and calling
    echo ini_get('upload_tmp_dir');

    gives me: [given i set it to that]
    /home/USER/tmp


    your query
    sys_get_temp_dir();

    gave me
    /tmp


    anyway NOW i get no errors, says file is uploaded but its no where to be found.
    not sure WTF is going on but clients wrecking my head and so is this.


    Problem only came to light when he tried to upload an image that was 3mb, not sure how this would change any of the system settings though.....

    also no, im not trying to upload a 3mb file, just small less than 100kb jpegs


  • Registered Users Posts: 241 ✭✭fcrossen


    Have you looked at the global $_FILES variable after upload?

    [PHP]// snip
    var_dump( $_FILES );
    // snip[/PHP]

    or

    [PHP]// snip
    $file_data_array = var_dump( $_FILES , true );
    // snip[/PHP]


  • Advertisement
  • Registered Users Posts: 8,070 ✭✭✭Placebo


    php.ini has to be everywhere with the script

    upload_tmp_dir = "/home/user/tmp"

    used this to check
    $_FILES



    so got it working



    having issue now with wordpress

    Please note, this is not a theme or so issue. The categories are not showing in the admin panel, however it denotes that there is 6 categories. They are also visible in the databse.

    Thinks its to do with the tmp folder issue again
    i tried setting these in wp-config

    define('WP_TEMP_DIR', '/tmp');
    define('DBCR_CACHE_DIR', '/tmp');

    but no avail


Advertisement