Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: tas562 on June 09, 2013, 09:41:37 PM

Title: can't upload any mods
Post by: tas562 on June 09, 2013, 09:41:37 PM
I'm having errors, please help.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/runestra/public_html/chat/Sources/Subs-Post.php on line 1655

the subs-post.php is the main problem. Here's the code on line 1655

if (count(array_intersect($allowed, $row['additional_groups'])) == 0)
continue;
}
Title: Re: can't upload any mods
Post by: shadow82x on June 09, 2013, 11:08:11 PM
The problem isn't with your code it's with your server configuration. Do a quick google search of "Fatal error: Allowed memory size" or contact your host for assistance.
Title: Re: can't upload any mods
Post by: Kindred on June 10, 2013, 01:06:27 AM
http://www.simplemachines.org/community/index.php?topic=502354.0
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 03:08:19 AM
This error message can spring up in a previously functional PHP script when the memory requirements exceed the default 8MB limit. Don't fret, though, because this is an easy problem to overcome.

To change the memory limit for one specific script by including a line such as this at the top of the script:
ini_set("memory_limit","128M");

Another way how this could be fixed is by modifying .htaccess file and adding this line to it:
php_value memory_limit 128M

i got this response from one of the staff members on the webhost.

Do i actually follow that?
Title: Re: can't upload any mods
Post by: Colin on June 10, 2013, 03:32:40 AM
Now your host, if responsive, should increase the limit on their end. But, please follow the second method that they listed. In the root of SMF edit the .htaccess file and add the line. Save the file and reupload it.
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 05:55:07 AM
I don't see any .htaccess file..
Title: Re: can't upload any mods
Post by: kat on June 10, 2013, 06:01:48 AM
It'll be there, almost for certain. Do you have your FTP client set to show hidden files?
Title: Re: can't upload any mods
Post by: Kindred on June 10, 2013, 07:23:34 AM
http://www.simplemachines.org/community/index.php?topic=502354.msg3531634#msg3531634
Title: Re: can't upload any mods
Post by: Storman™ on June 10, 2013, 08:29:15 AM
Your host is saying that their default is set at 8MB but thats not the case for you as your error message says:

QuoteFatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes)

...and 33554432 bytes equates to 32MB.

So your current setting is:  memory_limit = 32M

Increase it as mentioned above to 64M or even 128M as Kindred mentioned in his provided link. I've only mentioned this as the info your host gave you isn't entirely accurate.
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 01:31:22 PM
So i followed the phpinfo.php file > You can try and use a .htaccess file to overwrite the memory limit, but if the server controls it (which is probably the case, since SMF, I believe tries to set it high enough using ini_set when installing a mod package), than it probably won't work, and you are stuck with the server php memory limit.  Creating a phpinfo.php file, will tell you your php memory limit.
Code: [Select]
<?php echo phpinfo(); ?>

Alternatively, you could try and up the ini_set value on the php memory_limit when installing packages in SMF (not sure what the current setting is for this), but that might also work, using the ini_set

Code: [Select]
ini_set('memory_limit','64M');


& it should like this?

<?php echo phpinfo(); ?>
ini_set('memory_limit','64M');

If anyone can help me over teamviewer or something because i don't know what to do really, sorry.
Title: Re: can't upload any mods
Post by: Kindred on June 10, 2013, 01:35:27 PM
the phpinfo routine just shows you the information on how php is set up... it doesn't do anything or fix anything with regards to the memory limit.
and it is just the <?php echo phpinfo(); ?> line in the file.. that's it.

the other code line is something to try - but probably won't work anyway, since you will likely run into the memory limit on other pages as well...

you seem tohave missed the part below that where it talks about htaccess
Quote
In .htaccess, you can try to add the following:


php_value memory_limit 64M

If you add this and get a 500 Internal Server Error, than you are running PHP in CGI Mode, and should ask the server to up the memory_limit in the php.ini file, or perhaps you can do this yourself.  But if you can't, ask the server to do this.
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 01:39:54 PM
Ok, i can cancel my payment on hosting24 & move on to another host right now, so should i?
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 01:40:54 PM
Quote from: Kindred on June 10, 2013, 01:35:27 PM
the phpinfo routine just shows you the information on how php is set up... it doesn't do anything or fix anything with regards to the memory limit.
and it is just the <?php echo phpinfo(); ?> line in the file.. that's it.

the other code line is something to try - but probably won't work anyway, since you will likely run into the memory limit on other pages as well...

you seem tohave missed the part below that where it talks about htaccess
Quote
In .htaccess, you can try to add the following:


php_value memory_limit 64M

If you add this and get a 500 Internal Server Error, than you are running PHP in CGI Mode, and should ask the server to up the memory_limit in the php.ini file, or perhaps you can do this yourself.  But if you can't, ask the server to do this.
I do not see any .htacess file, if you want, you can teamviewer me please?
Title: Re: can't upload any mods
Post by: Kindred on June 10, 2013, 01:43:00 PM
if you are on hosting24...   then, since that is a host with known issues regarding overselling and incorrect reporting on the actual memory limits...  it is my opinion that, yes, you shoudl move hosts.  The actual decision is up to you...


I don't use teamview.
I am fairly certain that you do have an .htaccess file...   however, if you did not, you could create it.


that being said... if you are on hosting24, it won't matter. they don't report the memory correctly (it lies with the memory it reports as available) and they don't respect the increase command either.
Title: Re: can't upload any mods
Post by: Storman™ on June 10, 2013, 01:45:28 PM
As Kindred says it's your call but might not be necessary.

Creating a .htaccess is pretty simple.

It's merely a text file, for example like myfile.txt, only it's called .htaccess without the .txt ending.

You simply create that file, add the line that was mentioned:

Quotephp_value memory_limit 64M

or

Quotephp_value memory_limit 128M

........... and upload it to the root of your site. Done.

Maybe try that first ?
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 01:51:32 PM
Quote from: Storman™ on June 10, 2013, 01:45:28 PM
As Kindred says it's your call but might not be necessary.

Creating a .htaccess is pretty simple.

It's merely a text file, for example like myfile.txt, only it's called .htaccess without the .txt ending.

You simply create that file, add the line that Kindred mentioned, and upload it to the root of your site. Done.

Maybe try that first ?
Ok, so i'm assuming that i upload the .htaccess file on the smf directory?  (smf folder)
Title: Re: can't upload any mods
Post by: Storman™ on June 10, 2013, 01:52:42 PM
yep, same place as the index.php file  ;)

(P.S. If you get stuck send me a ftp login (via pm) and I'll do it a few minutes for you)
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 01:57:12 PM
Quote from: Storman™ on June 10, 2013, 01:52:42 PM
yep, same place as the index.php file  ;)

(P.S. If you get stuck send me a ftp login (via pm) and I'll do it a few minutes for you)

still giving me this error whenever i try to install a mod.

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/runestra/public_html/chat/Sources/Subs-Post.php on line 185
Title: Re: can't upload any mods
Post by: Storman™ on June 10, 2013, 01:59:55 PM
Doesn't look like it's doing anything.

Maybe post your .htaccess file as an attachment and we'll check it.
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 02:03:26 PM
I've done it correctly i believe
Title: Re: can't upload any mods
Post by: Storman™ on June 10, 2013, 02:05:08 PM
Yes it's correct which makes me wonder if your host allows it !

You could send back a support ticket to them and say what they suggested didn't work..

Or leave and go elsewhere...
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 02:06:36 PM
Quote from: Storman™ on June 10, 2013, 02:05:08 PM
Yes it's correct, try it again with:

Quotephp_value memory_limit 128M
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 122880 bytes) in /home/runestra/public_html/chat/Sources/Subs-Post.php on line 531


Nope..
Title: Re: can't upload any mods
Post by: Storman™ on June 10, 2013, 02:09:11 PM
Sorry see my edited post above (128 was never going to work)...  ;)
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 02:19:26 PM
Quote from: Storman™ on June 10, 2013, 02:09:11 PM
Sorry see my edited post above (128 was never going to work)...  ;)
will anything work? & i'm talking to the staff member again.
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 02:38:42 PM
so they replied with this comment

Should be fixed now.

I hope that I have addressed all of your concerns, but please feel free to reply this ticket if you require further assistance.


but i'm still experiencing the problem..
Title: Re: can't upload any mods
Post by: Kindred on June 10, 2013, 02:53:22 PM
Quote from: Kindred on June 10, 2013, 01:43:00 PM
that being said... if you are on hosting24, it won't matter. they don't report the memory correctly (it lies with the memory it reports as available) and they don't respect the increase command either.
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 02:56:18 PM
Quote from: Kindred on June 10, 2013, 02:53:22 PM
Quote from: Kindred on June 10, 2013, 01:43:00 PM
that being said... if you are on hosting24, it won't matter. they don't report the memory correctly (it lies with the memory it reports as available) and they don't respect the increase command either.
I use to host smf on hosting24 before & now i'm having this problem, but i'll switch hosts, thanks!
btw, which host is good? I can do 10-15$ monthly.
Title: Re: can't upload any mods
Post by: Kindred on June 10, 2013, 02:57:49 PM
we have a whole board filled with decent hosts. :)

personally, I use ICDsoft.
Title: Re: can't upload any mods
Post by: tas562 on June 10, 2013, 03:07:06 PM
Quote from: Kindred on June 10, 2013, 02:57:49 PM
we have a whole board filled with decent hosts. :)

personally, I use ICDsoft.
looks good, so it can host smf + other things like minecraft connecting to the webserver?
Title: Re: can't upload any mods
Post by: Kindred on June 10, 2013, 03:13:42 PM
not sure about that, since I only run websites, I don't play games :)
Title: Re: can't upload any mods
Post by: tas562 on June 12, 2013, 12:35:22 AM
I'm sorry, but I am unable to locate any real advice from the SMF staff on how this issue can be resolved. They seem to be trying to convince You that our memory_limit is not set to 128M. You can find our PHPinfo file @ http://server53.hosting24.com/phpinfo.php which indicates that the memory_limit is in fact set to 128M.

We would suggest getting in touch with their support again explaining them that the memory_limit is in fact set to 128M or try using a different forum software which does not have such issues.

they're saying that the memory issue or w/e is fine..If so, what's causing this error?
Title: Re: can't upload any mods
Post by: kat on June 12, 2013, 06:29:54 AM
Just a small hunch, this...

Can you confirm, with your host, that you have full CHOWN ownership of the files on your site?
Title: Re: can't upload any mods
Post by: Kindred on June 12, 2013, 09:56:42 AM
K@, that would not have any effect on the memory limits...


tas...
http://www.simplemachines.org/community/index.php?topic=502354.msg3558991#msg3558991
Title: Re: can't upload any mods
Post by: kat on June 12, 2013, 10:01:24 AM
No, it wouldn't. But, as his host claims he has 128 meg, I'm kinda fishing... :P