Cannot upload file with php!

Hi guys,

Write so i have a linux server - its running Centos 5.X with apache2! No firewalls as long as im aware of ... However i cannot upload ANY files to the server .. yes i am aware of the file limits in the php.ini but i cannot even upload 1k files with simplest example such as the one here :

The folder is created, it is 777 but still nothing!

What am i doing wrong?
Who is Participating?
No you got an error code.


Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3.
nobodynowherenothingAuthor Commented:
By the way guys, Yes uploading files is on in php.ini ... and i have restarted the web server after enabaling it ..
Are you sure you have modified the right php.ini? Sometimes there can be multiple php.ini's.

Also does the script output any error at all?

Let me know how you go.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

try this

<form enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="2048000">
File: <input name="userfile" type="file" /><br />
<input type="submit" value="Upload" />

if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) {
copy($_FILES["userfile"]["tmp_name"], "images/" . $_FILES["userfile"]["name"]);
echo "<p>File uploaded successfully.</p>";

Note: this will move the file to the folder images ... if it does not exist either create it or change the script to the directory of your liking
nobodynowherenothingAuthor Commented:

@ nizsmo:

Right yeah i did :

dns28:/var/www/virtual/ locate php.ini

And as you can see there is only 2 files and i maked sure in both php upload is on and restarted the web server ..

Been working on this since the morning .. really out of ideas ... Also i do not get any errors ...


Ok i tried that .. the folder is created permission is 777 when i select a file and press upload .. the page reloads and comes back to the form so from my underestanding

if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) {

It is not set so it displayes the form again ...

Thanks for responses
it is supposed to display the form again ....  and under the form a notice "File uploaded successfully".
nobodynowherenothingAuthor Commented:
Ok guys got more information so i did :


and  now i get:

Array ( [userfile] => Array ( [name] => CV.docx [type] => [tmp_name] => [error] => 6 [size] => 0 ) )

So the file has been uploadded right?

nobodynowherenothingAuthor Commented:

Yeah but no notice .. and as i check in the folder no file ...

nobodynowherenothingAuthor Commented:

Your awsome thank you! Went into php.ini and i setup a temp folder and its working now!

Wow such a reliefe .. Thank you
Glad i could help :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.