Jump to content

[SOLVED] $_FILES array is empting after reinstalling apache and Mysql. Please help!!!


Recommended Posts

Hi guys.

 

Here on my development machine I have a porblem with my $_FILES arrays that I cannot resolve. Returns and empty array that I cannot find a solution for. I have searched and tried many things without any success.

 

Originally I had a old version of xampp installed. So U updated to the current one. That failed so I installed apache, mysql and php all from scratch and I still get an empty $_FILES array. All the latest versions installed yesterday

 

Here is the code I am using for testing in a file called test.php.

<html>
<body>
<?php
echo 'file';
print_r($_FILES);
echo 'end';
print_r($_POST);
set_time_limit(0); 
ini_set('upload_max_filesize', '100M');
?>
<form action="test.php" method="post" encytype="multipart/form-data">
	<input type="file" name="test_file" />
	<input type="submit" />
</form>
</body>
</html>

 

As you can see I have brought it down to its raw source.

There are is only 1 form, the encytype="multipart/form-data" is included, it is posted. I have also checked all the relevant setting in the php.ini file to make sure they are correct.

 

post_max_size = 8M

file_uploads = On

upload_tmp_dir = 'C:/php/tmp'

upload_max_filesize = 2M

 

PHP, apache and mysql all work fine and I am able to copy files to the temp directory. I am logged in with administrator right, I am the only person using this machine. My machine is running Vista.

 

This is the results I get returned when I try to upload a standard jpg file.

 

file array
Array ( )
post array
Array ( [test_file] => IMG_8555.jpg )

 

I have also outputted the $_SERVER['CONTENT_LENGTH'] which does output a small value. IE 24.

This varies dependent on what file I upload. However I have never seen it above 50.

 

Can someone please provide some direction. I have no idea.

 

Thanks

 

What does a phpinfo() statement show for the actual file_uploads setting?

 

If the php.ini that you are changing is not the one that php is using or you did not stop and start your web server to get any change made to the php.ini to take effect, it does not really matter what the settings in the php.ini are.

I have also checked that and I am editing the correct php.ini. As I said I installed Apache, Mysql and PHP all from scratch so I had to link them all together so I know where it is. In addition I have made edits to the php.ini file that have been reflected in the output.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.