Fixing “Missing a temporary folder” error on Wordpress 2.7 uploader

Homepage > Diary > Coding > Fixing “Missing a temporary folder” error on Wordpress 2.7 uploader

Sun 01/04/2009

in Coding, PHP

Recently I’ve found that some local (XAMPP powered) installations of Wordpress 2.7 on Linux and Mac return an odd error when user tries to upload a media by both the flash and the browser uploader.
The error raised is Missing a temporary folder as shown in the picture below:

Wordpress 2.7 missing temporary folder error

Wordpress 2.7 missing temporary folder error

I’ve not yet dug the problem, anyway it seems related to misconfigured temporary paths in the local environment.

You can easily overcome this problem by editing the php.ini file located in etc/ folder, uncommenting the line  upload_tmp_dir (by deleting the semi-colon “;”) and pointing the variable to a folder using an absolute path. In Linux possible steps are:

  1. open a terminal
  2. create a temporary folder for all apache tasks in your user folder and grant all right to all users:
    mkdir wwwtmp && chmod 0777 wwwtmp
  3. edit php.ini with your text editor and set the temporary folder (you must switch to root user)
    su
    vim /opt/lampp/etc/php.ini
    upload_tmp_dir = /home/my_user/wwwtmp/

    Remeber to remove preceding “;”

  4. save the file (in vim type :wq an press enter) and restart xampp
    /opt/lampp/./lampp restart

If everything went fine the error won’t be raised anymore.

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • BlinkList
  • blogmarks
  • DZone
  • LinkedIn
  • MySpace
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Ping.fm
  • Yahoo! Buzz

Tags: , ,

47 Responses to this post:

  • Storm says:

    Thanks. This was the article I needed!

  • Reader says:

    Great! Thank you very much!
    I always wanted to write in my site something like that. Can I take part of your post to my blog?
    Of course, I will add backlink?

    Regards, Timur I.

  • Dwight Jack says:

    Pleased it worked, anyway i’ll also try to find a solution for those who don’t have direct access to php.ini…

    @Reader: Sure you can use this post, and backlinks are welcome :D
    bye!

  • Игорь says:

    Тоже процитирую Вашу статью у себя в блоге

  • HMTKSteve says:

    I am having a strange problem. I have two wordpress sites on the same server. One has no problem uploading while the other gives me the missing temporary folder error.

    Both use the same wp-content/uploads directory and all permissions match. Any idea why one would work and not the other?

    On the one that does not work I also have a vbulletin forum and that software has no problem uploading.

  • Dwight Jack says:

    I don’t know if you already did this, but you should check the phpinfo() output and compare the upload dir value. It could be that domain’s conf file is overriding the php.ini configuration

  • sean says:

    Thanks a million, this did the trick.

  • LAM says:

    Thanks. This worked great.

  • jussi says:

    Thanks a lot! This saved me a lot of hairpulling.

  • Joe says:

    Love your work.

  • [...] E un mesaj destul de vag si mi-a luat ceva timp sa inteleg ce se intampla. Aici afli cum sa iti setezi un folder temporar pentru Apache in php.ini: http://www.dwightjack.com/diary/2009/01/04/fixing-missing-a-temporary-folder-error-on-wordpress-27-u... [...]

  • notcaslon says:

    Sound like the exact problem i am having. I am un able to upload an exported WORDPRESS .xml file from one blog into another.

    My error is:

    Import WordPress

    Sorry, there has been an error.

    Missing a temporary folder.

    The only issue with this fix is that its not written in plain english, that is some one with basic knowledge of php admin interface has no idea where to start, step by set with images would be great for people as above mentioned….

    like me!

  • vc27 says:

    way to be!!! Thanks a Lot ^_^!!!

  • Fang Jin says:

    thanks man, it worked.

    my blogger is fully functional locally on my leopard.

  • Alex says:

    I love you, man!
    Anyway it worked for me on a mac, but with one important variation:

    upload_tmp_dir = /Users/YourUserName/wwwtmp

    I know it seams stupid to tell, but it was not working for me because of that linux-path you posted….so, please, tell me I’m not the only stupid in the fu***ng WorldWideWeb! :-)

    • Finn Connell says:

      I have uncommented php.ini and changed to

      upload_tmp_dir =” /Users/myusername/wwwtmp” but still “missing temporary folder”

      I am using Mac and xammp and wordpress Should I put in a different path in php.ini? what is the exact path? I created a folder called wwwtmp and I still have absolutely no luck.

      I also seemed to have sent the Terminal nuts as it now says
      ~
      ~
      “/opt/lampp/etc/php.ini” [New DIRECTORY]
      and no insertion point.

      • Dwight Jack says:

        Not really a Mac exteprt, anyway that folder seems ok.
        Did u try to write the folder without quotes:

        upload_tmp_dir =/Users/myusername/wwwtmp

        • tinygod says:

          i do it,but the system tell me:
          Unable to create directory /Applications/xampp/xamppfiles/htdocs/blog/wp-content/uploads/2009/03. Is its parent directory writable by the server?
          can u help me?

        • Prestige says:

          Same problem here /Applications/xampp/xamppfiles/htdocs/blog/wp-content/uploads/2009/03. Is its parent directory writable by the server?

          hope somebody posts a solution.

          Cheers!

        • Dwight Jack says:

          Hi, i’ve given the problem a quick look and i’ve found a long post about it in the WP support forum. Since i can’t reproduce the error, i suggest to try first of all this solution by sassymonkey. let me know if you find something to fix the issue!

          PS: if it doesn’t work and u don’t need to organize uploads in folder u can try unchecking the “Organize my uploads into month- and year-based folders” setting in Settings -> Miscellaneous

  • DanielPK says:

    Hey, i can’t use this method, because i don’t have access to my “Server files” and i don’t have any php.ini file in my directory!! how can i solve this without access to those files??? please need help badly!!

    Thanx in advance

  • Markcc says:

    Worked perfectly, I didnt use terminal I logged into WHM on server and adjusted the PHP ini file there. great! thank you

  • Get Geeky says:

    Fix “Missing a temporary folder” in WordPress 2.7…

    As I was writing my article about the installation process of Openfire, I’ve tried to upload a file but got an error message instead of my file
    Because I wasn’t able to upload a file, I’ve done a quick google search and found this b…

  • Kamil Tatara says:

    Hi! Where I can find that php.ini file? in my root files or in wordpress folders? I have mac and i dont see any .ini files :( help

  • jobucks says:

    where to find php.ini file, I can’t find it please help…

  • lisa says:

    i have no idea what all this means to be honest, i have the missing error problem, i’m on a mac!!!

  • [...] Fixing “Missing a temporary folder” error on Wordpress 2.7 … [...]

  • Millo says:

    Hi!
    I got the error. I’m using Windows XP and the blog is on a host right now.
    Everytime I try to upload images, it reads:

    /vservers/h267740wp/htdocs/wp-admin

    I login to my FTP server, went to the ETC folder and access to the php.ini file.
    The line goes like this:

    upload_tmp_dir = /vservers/h282184wp/tmp /vservers/h267740wp/tmp

    I just don’t know what I have to change. i’ve created “tmp” folders everywhere, but nothing works.

    What do I have to change and where? what should I put on “Store uploads in this folder”???

    Thanx a lot for your help

  • Dwight Jack says:

    Hi,

    i’d try setting the upload_tmp_dir like this (note the trailing slash):

    upload_tmp_dir = /vservers/h267740wp/tmp/

    Then remember you have to restart your web server. Usually you may issue a:
    /etc/init.d/httpd restart

    For the upload folder, usually the default is fine:
    wp-content/uploads

    You should try and check if /vservers/h267740wp/htdocs/wp-content/uploads it’s present and it’s writtable (like 775 in permission)

    Let me know if it works, bye!

  • Jestin says:

    Thks dud….
    it help and o was able to rectify my trouble!

    Thank U again ;)

  • [...] Fixing “Missing a temporary folder” error on Wordpress 2.7 uploader :: Dwight Jack Diary (tags: wordpress php workaround apache bug) [...]

  • Neill Jones says:

    Just a small point …

    I changed the temp directory to /tmp which is available on some (if not all??) linux systems. So long as Apache has rw access to it it should work too. That way you don’t have to have a temporary directory added to your home directory.

    Cheers

    Neill

  • rosie says:

    I also had this issue. I checked my web hosting and I was running with php version 4. The upgraded wordpress recommended version php 4.2 and above. Once I had moved to version php 5 this problem was resolved.

  • Lewis says:

    Thanks guys. An upgrade to php 5 fixed my problem too.

  • Lee says:

    I got the same error with my WP-powered blog (2.7V) and this is how I fixed mine: go to your dashboard:
    SETTINGS–> Miscellaneous
    Store uploads in this folder
    DELETE the word “directory”,
    thus, settings will be
    default. So it will look like
    this [wp-content/uploads].
    Before, it looks like this;
    [directory/wp-content/uploads], just delete directory/. IT WORKS!

  • Mandy says:

    I added the first few lines to my .htaccess, so this is what I ended up with.

    SecFilterEngine Off
    SecFilterScanPOST Off

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    And it started working :)

  • Mandy says:

    I added the first few lines to my .htaccess, so this is what I ended up with.

    SecFilterEngine Off
    SecFilterScanPOST Off

    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

Leave a Reply ()

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

* required.