Re: How to assure that php.ini is being obeyed?
| From: | Mailit, LLC | Date: | Thu, 18 Nov 2004 21:03:16 +0000 |
| Subject: | Re: How to assure that php.ini is being obeyed? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202466@lists.php.net to get a copy of this message | ||
Sebastian Mendel,
I am using simple scripts to verify this file size issue:
The Html file that accepts the job is as follows:
<form enctype="multipart/form-data" action="uploading.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="8000000" />
<p>Send this file: <input name="userfile" type="file" />
<p><input type="submit" value="Send File" />
</form>
The action php script is as follows:
<?php
# uploading.php - Process the saving of an uploaded file
$name = $_FILES[userfile][name];
$type = $_FILES[userfile][type];
$size = $_FILES[userfile][size];
print( "The file is called $name, type $type, size $size<br>" );
print( "Error message: $php_errormsg<br>" );
?>
I don't know how to see the error message, because when I submit a large file for uploading, it does not even
execute the php script; the message "This document contains no data" pops up; if I click on "OK", the php script
is not executed. I think I need a function that will catch the error before the system message pops up, but I don't
know how to code it.
So, that is why I am baffled. The error message that I see is not explanatory of the real situation.
Mario Miyojim
Sebastian Mendel wrote:
Llc Mailit wrote:did you check $php_errormsg ? "track_errors boolean If enabled, the last error message will always be present in the variable $php_errormsg."I set display_errors, startup_errors, track_errors On in php.ini, restarted Apache and reran an upload session. The only error message displayed upon attempt to upload a large file is "This document contains no data" The specified log file is empty.also, when using apache 1.3.2 or later, see the LimitRequestBody directive.My problem: To upload large files. Although /etc/php.ini on my Linux server specifies upload_max_filesize = 8M post_max_size = 8M only files smaller than 512 kB are uploaded, while larger files fail with message "This document contains no data"quota? free space? try setting display_errors and startup_errors on try track_errors with on