Magento Forum

New installation runs out of member despite 64MB limit
 
tonedoggydogg
Jr. Member
 
Avatar
Total Posts:  28
Joined:  2008-01-19
 

Hello world.
I am running the following:
Linux box with Apache 1.3.41 (Unix)
MySQL 4.1.22
PHP 4.4.8 with PHP 5.2.3 available using .php5

Note the following:
Magento is installed in a subdir named /shop)
I added this to .htaccess: (which appears to work)

AddHandler application/x-httpd-php5 .php

I recently installed Magento and upon my very first visit to the live site, I received the following error:

Fatal errorAllowed memory size of 8388608 bytes exhausted (tried to allocate 19456 bytesin  shop/app/code/core/Mage/Eav/Model/Entity/Abstractold.php on line 371

Obviously I was crushed, since I expected to see a brand new shop. Nonetheless, I increased my php settings using whm (since my server runs cPanel) to 64MB. I have attached my php.ini file to prove this.

I’ve also attached my .htaccess file, and see that there’s a memory_limit directive to change to 32MB, which is less than the default 64MB. However, based on the current error, BOTH are ignored. (The current error acts as if only 8MB are allocated.) Does anyone know what the problem could be?

File Attachments
php_ini.txt  (File Size: 43KB - Downloads: 1041)
htaccess.txt  (File Size: 3KB - Downloads: 469)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Probably the configuration in cPanel affects PHP4 settings only.

The error shows that your memory_limit is 8MB.

In .htaccess you will find these lines:

############################################
## adjust memory limit

# php_value memory_limit 32M
Please uncomment line with memory_limit 32M and see how it works.
 
Magento Community Magento Community
Magento Community
Magento Community
 
tonedoggydogg
Jr. Member
 
Avatar
Total Posts:  28
Joined:  2008-01-19
 
Moshe - 18 February 2008 08:21 AM

Probably the configuration in cPanel affects PHP4 settings only.

The error shows that your memory_limit is 8MB.

In .htaccess you will find these lines:

############################################
## adjust memory limit

# php_value memory_limit 32M
Please uncomment line with memory_limit 32M and see how it works.

As before, Magento ignores .htaccess and php.ini. After uncommenting the php_value memory_limit 32M line, I received a duplicate error:

Fatal errorAllowed memory size of 8388608 bytes exhausted (tried to allocate 19456 bytesin shop/app/code/core/Mage/Eav/Model/Entity/Abstractold.php on line 371

Magento is ignoring the memory_limit. This has to be a software issue if it ignores .htaccess and php.ini. All other domains on the server are adhering to the memory increase to 64MB, including those using PHP5. Out of curiosity, why would an empty shopping cart need so much memory anyway?

 
Magento Community Magento Community
Magento Community
Magento Community
 
tonedoggydogg
Jr. Member
 
Avatar
Total Posts:  28
Joined:  2008-01-19
 

I figured it out, thank God.

After closely reviewing my .htaccess file, I did in fact realize that all of the PHP-related directives are referring to PHP4 settings. Because my server is set to PHP4 by default and PHP5 only when instructed, I had to modify a couple of the directives to refer to PHP5 exclusively. So pay close attention below: (I essentially replaced “php_value” to ”php5_value”. I personally did not need the max_execution_time directive, but you may need to uncomment it if your system hangs.)
<IfModule mod_php5.c>

############################################
## adjust memory limit

php5_value memory_limit 32M
# php5_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

php5_flag magic_quotes_gpc off

############################################
## enable php short tags for templates

php5_flag short_open_tag on

</IfModule>

Remember that when running PHP4 and PHP5 side by side like our servers, you will also have to add ONE of the following directive towards the top of your .htaccess:

Either: (this one worked for us)

AddHandler application/x-httpd-php5 .php
OR (uncomment the following statements and upload it to your domain’s cgi-bin)
Action php5-cgi /cgi-bin/php-cgi
AddHandler php5
-cgi .php

Note that the former definitely works if you have PHP5 installed, but not as the primary version. The latter works if you do not have PHP5 and do not have the ability to install it. (If you’re on a shared server, you probably won’t have the right to install it, so the latter option is much more preferable. Or you can just go with a host that has PHP5.) If you have PHP5 installed as the primary processor, then you probably don’t need to read this altogether. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
lindaw
Sr. Member
 
Total Posts:  201
Joined:  2007-12-25
 

Hey thanks Tone, worked a treat.

Have you had any problems since?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top