Forum Moderators: coopster
I have a phpbb site (2.0.10) running on RedHat box. I have installed Attachment Mod successfully. If you are not familiar with this mod, it allows people to insert attachments in their posts (like jpg, doc, etc.). Before finding the Attachment Mod, I had someone write a similar script to allow users to upload video files.
In the past, I have uploaded videos through my custom script there were several MB's in size. I have only used the Attachment Mod to upload relatively small attachments within my posts.
For some reason, I can no longer upload anything larger than 500KB. This is through either my custom script or the Attachment Mod. I am new to web hosting, and may have done something to cause this. I am at my wit's end and don't know what to do or check.
I wrote a third script because I could not find solution/problem, and it also will not allow me to upload anything greater than 500kb. It looks something like this:
<?php
if (isset($_FILES['tst']) && is_array($_FILES['tst']) && isset($_FILES['tst']['tmp_name']) && is_uploaded_file($_FILES['tst']['tmp_name'])) {
copy($_FILES['tst']['tmp_name'], 'upload/'.$_FILES['tst']['name']);
unlink($_FILES['tst']['tmp_name']);
echo 'Uploaded file: '.$_FILES['tst']['name'].', '.$_FILES['tst']['size'].' bytes';
}
?>
<form enctype="multipart/form-data" action="upload_test.php" method="post">
Send this file: <input name="tst" type="file" />
<input type="submit" value="Send File" />
</form>
I have triple verified the things that I know to check. The attachment mod has a nice admin interface, and I have everything set to allow up to 4MB attachments. My php config is set to allow up to 8MB uploads. I have looked at Apache config files today. It is the first time I have ever looked at them. I don't understand most it, but it seems pretty straight forward.
I don't know where to check. Any help would be greatly appreciated.
BTW, I can FTP all the data I want. I also tried the script above on another domain on the same server, and it again won't allow upload of anything bigger than 500KB.
[edited by: jatar_k at 12:00 am (utc) on Nov. 24, 2004]
php_admin_value upload_max_filesize 52428800
php_admin_value post_max_size 52439040
php_admin_value memory_limit 209756160
LimitRequestBody 52439040
Line 1 is what you probably already do. As the file data is sent as part of a POST request, Line 2 adjusts the maximum size of a POST request. The default is much smaller. Line 3 gives more memory to PHP in general. I needed to set it to four times the file size, because the script does a lot of mambo jambo with the uploaded file. Probably not necessary in your case. Line 4 does the same to Apache as Line 2 does for PHP. HTH