View Full Version : Magento ecommerce site has fatal error due to memory - anyone else w/ similar issue?
09-10-2009, 10:34 AM
I'm trying to get the Magento ecommerce shopping site up and running, which was installed through Simple Scripts (via HostMonster Cpanel). All went in fine, however I'm running into a major issue with the cart =
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71681 bytes) in
The memory allotment that I have listed is 128MB in both the .htaccess and php.ini.default file, which I thought would do something but doesn't seem to do anything.
Anyone else run into this problem or have a suggestion?
09-10-2009, 12:14 PM
Have you tried running your account with php single file mode turned on? If you don't, then you will have to make a copy of the php.ini file and place it in every directory in which you want to run php scripts.
PHP Single File mode will allow your entire site to run off a single php.ini file. You can make the change inside CPanel, under the php config menu option.
09-10-2009, 12:26 PM
Setting the PHP memory limit will not work through .htaccess on the HostMonster servers. You must specify your settings through php.ini instead.
Furthermore, the server will not read php.ini.default. It will recognize php.ini so rename the file.
09-11-2009, 08:06 AM
PERFECT - thanks both of you! I had already set this for one php.ini, but what was killing me was the ".default" part. I renamed it and boom - one working shopping site :)
man, so many hours fretting over this for a simple rename.
09-18-2009, 06:09 AM
I am about to set up Magneto. Is it always necessary to rename php file? And what type of name should default be changed to? Will any name do?
Thanks for any help you can give.
09-18-2009, 09:05 AM
The default php.ini file should be renamed to php.ini. Any other name will not work. It is only necessary to rename this file once, unless you reinstall the default file ...
09-18-2009, 03:12 PM
Mine is php5.ini, will this not work? Php setting is PHP5 (Single php.ini). I get fatal error due to allowed memory size very frequently.
I have tried renaming to php.ini, but this causes an error and the site will not load at all, I just get the parent directory.. Have also tried removing .htaccess, this also causes the same problem, site will not load.
Does anyone have any suggestions?
11-19-2009, 06:34 AM
Lars, I don't know about the naming of the php.ini file. I suppose if renaming it to the standard name "php.ini" breaks your site, then leave it as it is.
As far as your memory allocation errors, it sounds like your scripts are not handling memory usage very well, which might indicate a poorly written script, or a php.ini setting that is too low ...
Open your php.ini file and look for the following variable:
memory_limit = 32M ; Maximum amount of memory a script may consume (32MB)
Change that 32M number to something higher, like 48M to start. After that, I would start looking at your scripts. If you are good with php, then you can find the problem yourself. If not, or you installed a program like Magento, then go to the developer website and see if there are any updates you can install. Your other option will be to higher a php developer to look at your scripts to see where they can be optimized to use less memory.
The reason I say all this is because poor memory usage can lead to your site being "unavailable" to your users, which is never a good thing ...
Thanks for the fast reply.
Actually, I tried installing the default.php.ini from the php config in cpanel, renamed it to php.ini, and moved the php5.ini out of the way. That actually worked, so I guess the problem was my original php5.ini file. The two look completely different - the php5.ini seems to be for CGI/FastCGI installations, so the problem was probably that the correct php.ini was lacking.
Another question - even though setting memory limit through .htaccess wil not work on hostmonster servers, other settings, such as setting default index file still works through editing .htaccess, right?
11-19-2009, 07:05 AM
I believe that's correct, and I'm not aware of the list of "allowed .htaccess settings". I believe - and you should check me on this - that any settings that reconfigure the environment are not allowed. Trivial settings such as rewriting urls and setting index files is fine. Support would be a great place to ask this question.
04-08-2011, 03:23 AM
Yes, you are absolutely right. I have also faced same type of problem while working with Magento but now I have switched to ZenCart and it's really working very well.
08-04-2011, 10:43 PM
The simple thing which you need to do is upgrade your website, for this thing you must have a backup file in order to editing in them and a simple solution which I like to suggest you to attach opencart Templates form along with Magento Commerce site. Then all of the problems you are facing would be resolved if you attach up a strong shopping cart form.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.