MyBB Community Forums

Full Version: Error: Can not upload file - Too large for php post_max_size directive.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there. I started using MyBB some days ago, little after the 1.8.9 release and I'm currently building a forum in order to test some things out. Although I've ran into some problems, I got to solve them by myself before. This one, however, is giving me a big headache.

For any topic I try creating, I get a "Can not upload file - Too large for php post_max_size directive." error. It doesn't matter whether I actually upload/attach anything to the first post or not, even if I make a post with a single word written on it I get this error. Before, I was getting a blank screen right after creating the topic, and if I refreshed it, this error would appear, but the topic was created normally. I tried changing the post_max_size directive in php.ini directly in my server (since I'm hosting the forum in a DigitalOcean droplet, I have direct access to it through SSH) to a higher number (100MB), but that didn't solve the problem. I tried searching for it on Google and found out that one person was able to solve it by reuploading the forum original files in a very old version of MyBB (1.4 or so). I tried doing that as well with the 1.8.9 files but that also didn't work. Now, I don't even get the blank screen anymore, the error simply appears after I try creating any topics and no topic is created after all.

Below are screenshots of the error and of my php info page (so you can see that the post_max_size is indeed set to a high number):

[Image: AgUEMpc.png]


[Image: Yml9NMO.png]

The forum link is hikiana.moe/forum.

I would be very grateful if someone could help me solve this. Thanks in advance.
At the top of ./newthread.php, before:

define("IN_MYBB", 1);

can you add:

echo '<pre>';print_r($_POST);echo '</pre>';

and try to submit a thread again, and post the output?

If the output you see has a line that starts with/contains 'my_post_key', please remove the value (a 32 character string) before posting, as that value should be kept secret Smile
(2016-12-25, 10:58 PM)Matt Wrote: [ -> ]At the top of ./newthread.php, before:

define("IN_MYBB", 1);

can you add:

echo '<pre>';print_r($_POST);echo '</pre>';

and try to submit a thread again, and post the output?

If the output you see has a line that starts with/contains 'my_post_key', please remove the value (a 32 character string) before posting, as that value should be kept secret Smile

Tried it. All that happened is that this appeared at the top of the page:

Array
(
)

The error is still there. Here's a screenshot: http://i.imgur.com/1uXLfZ6.png
Interesting... okay, create a new file called test.php, put this in it:

<?php
if(!empty($_POST))
{
	echo '<pre>';print_r($_POST);echo '</pre>'; 
}
?>
<form action="" method="post">
	<input type="hidden" name="test" value="hi, you should see me" />
	<input type="submit" name="submit" />
</form>

Visit this file in your browser, you should just see a submit button, click it, what output do you see?
(2016-12-25, 11:14 PM)Matt Wrote: [ -> ]Interesting... okay, create a new file called test.php, put this in it:

<?php
if(!empty($_POST))
{
	echo '<pre>';print_r($_POST);echo '</pre>'; 
}
?>
<form action="" method="post">
	<input type="hidden" name="test" value="hi, you should see me" />
	<input type="submit" name="submit" />
</form>

Visit this file in your browser, you should just see a submit button, click it, what output do you see?
This:

Array
(
   [test] => hi, you should see me
   [submit] => Enviar dados
)

Screenshot: http://i.imgur.com/KKVgsm9.png
Also interesting... okay, have you renamed the htaccess.txt file that comes with MyBB to .htaccess? If you have, can you remove it/rename it back to htaccess.txt?
(2016-12-25, 11:20 PM)Matt Wrote: [ -> ]Also interesting... okay, have you renamed the htaccess.txt file that comes with MyBB to .htaccess? If you have, can you remove it/rename it back to htaccess.txt?

I hadn't renamed it, but... I tried renaming it to .htaccess and nothing changed. Renamed it back to htaccess.txt and no changes as well.
That's fine, if it was already still called htaccess.txt it wouldn't have been the case anyway.

There seems to be some threads that have been created, has anything changed on the server or the forum since these ones worked?
(2016-12-25, 11:31 PM)Matt Wrote: [ -> ]That's fine, if it was already still called htaccess.txt it wouldn't have been the case anyway.

There seems to be some threads that have been created, has anything changed on the server or the forum since these ones worked?

Yeah, up to some hours ago this error message was appearing but the threads were still being created, and I was trying to find a way to make the error message disappear. I tried changing the php.ini directive to a higher value but that didn't solve the problem, then I tried reuploading the original MyBB files since someone in another thread solved it that way in an older version but after that it stopped creating threads altogether.

Edit: Well, I've decided to do a clean reinstall of MyBB and redo whatever changes I made. If this error pops up again somewhere in the proccess I'll post here again.
So, after reinstalling MyBB and setting everything up again, the error didn't appear at first. Later on, after I installed a shoutbox plugin called Miuna Shoutbox, which was also installed before, it appeared again, although the threads were being created regardlessly. I messed with the settings a bit and discovered that what was causing the error message was the shoutbox "Shout New Threads" and "Shout New Posts" functionalities. After I disabled these everything returned to normal.

Anyway, since this seems to be a problem in the plugin and not with MyBB itself, I'll just contact the creator so he fixes it. Thanks for the help.