Forums / Bug Reports / php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Views: 35,254

Results 21 to 40 of 62
26 Nov 2013, 1:37 AM
#21
gsmsalers avatar

gsmsalers

New Zenner

Join Date:
Feb 2009
Posts:
71
Plugin Contributions:
0

php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

I also started experiencing same problem after I migrated to Godaddy "Ultimate" shared hosting from another Godaddy hosting. I copied fixed version of "session.php" from github. But problem persist. FYI: My zen cart version is 1.51
Here is error message from Godaddy when I try to login. It stuck on below blank page.
/index.php?main_page=login&action=process

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
"
Here is Zen cart log.

[26-Nov-2013 01:24:40 UTC] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 693694233 bytes) in /home/xxxxx/public_html/includes/functions/html_output.php on line 62
"
Is there any other fix?

DrByte:

Changes committed to github: https://github.com/zencart/zencart/commit/8f47bc47bdf6c8a189f51d00e26deb80026d2886

27 Nov 2013, 2:28 AM
#22
avibodha avatar

avibodha

New Zenner

Join Date:
Nov 2007
Posts:
25
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Since the code that was causing this problem in sessions.php was removed, you'll need to find where html_output.php is getting called.

You can either install the Xdebug module which will automatically log a stack trace on errors or you could try and put debug_backtrace() in the register_shutdown_function() that's in the new session.php. Post what you find.

3 Dec 2013, 2:10 PM
#23
kagaroo avatar

kagaroo

New Zenner

Join Date:
Nov 2013
Location:
New York
Posts:
30
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

I got the same "PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1605959449 bytes) in /home2/zzzzz/public_html/includes/functions/html_output.php on line 77" error. I changed session.php as Dr. Byte pointed out. The error still exists.

This just happened when my host removed php 5.3 and forced us to use either php 5.4 or 5.2 two days ago. When I choose php 5.4, the customer login became blank after all the user name password stuff. In the log folder, I can find the above error log. However, if I switch to 5.2, the problem went away. It seems that this problem is php version related. I talked with my host and was told that they are going to pull away php 5.2 very soon. Therefore, we have to find a solution to this error before they do that. Please post your solution if you have solved this problem. Thank you!

3 Dec 2013, 2:21 PM
#24
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

kagaroo:

I got the same "PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1605959449 bytes) in /home2/zzzzz/public_html/includes/functions/html_output.php on line 77" error. I changed session.php as Dr. Byte pointed out. The error still exists.

This just happened when my host removed php 5.3 and forced us to use either php 5.4 or 5.2 two days ago. When I choose php 5.4, the customer login became blank after all the user name password stuff. In the log folder, I can find the above error log. However, if I switch to 5.2, the problem went away. It seems that this problem is php version related. I talked with my host and was told that they are going to pull away php 5.2 very soon. Therefore, we have to find a solution to this error before they do that. Please post your solution if you have solved this problem. Thank you!

PHP 5.2 and 5.3 have reached end of life.

You may have some custom coding in your install which does not cope well with PHP > 5.2

Try and install a demo vanilla ZC 1.5.1 version on your server somewhere in a subdirectory, switch to PHP 5.4 and see what happens. I bet you won't have a problem with the demo install. But if you do, then that could be due to server configs.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

3 Dec 2013, 3:42 PM
#25
kagaroo avatar

kagaroo

New Zenner

Join Date:
Nov 2013
Location:
New York
Posts:
30
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Just fresh install zc 1.51 version on my server and test as frank18 suggested. Yes, no problem, I can log in without any problem.

For my site, it was originally for the zc 1.38 and recently upgraded to zc 1.51. It was running smoothly on php 5.2 or 5.3. but not on php5.4.

When switch to php5.4, there two files seems to have problem when customers try to log in.
includes/functions/html_output.php on line 77
includes/classes/seo.url.php on line 215

Both line has the same code nearby.

    if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
      if (defined('SID') && zen_not_null(SID)) {
        $sid = SID;

I have ultimate seo url module installed. But I still get the same error when I disable seo module.

3 Dec 2013, 8:59 PM
#26
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

kagaroo:

Just fresh install zc 1.51 version on my server and test as frank18 suggested. Yes, no problem, I can log in without any problem.

... as predicted :smile:

kagaroo:

For my site, it was originally for the zc 1.38 and recently upgraded to zc 1.51. It was running smoothly on php 5.2 or 5.3. but not on php5.4.

When switch to php5.4, there two files seems to have problem when customers try to log in.
includes/functions/html_output.php on line 77
includes/classes/seo.url.php on line 215

Both line has the same code nearby.

if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
  if (defined('SID') && zen_not_null(SID)) {
    $sid = SID;
> I have ultimate seo url module installed. But I still get the same error when I disable seo module.

I would now install ultimate seo on the new demo site and then test again if it works on PHP 5.4

If it does, then compare your live site to your demo site - you may be able to find the piece of code which causes you trouble with PHP 5.4

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

4 Dec 2013, 5:40 AM
#27
kagaroo avatar

kagaroo

New Zenner

Join Date:
Nov 2013
Location:
New York
Posts:
30
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Read the previous messages, the sympton of my site is exactly like WayneStephens in the first page. If customers have some merchandise in the shopping cart, then there is no problem to login and the page will be directed to shopping cart page again. However, if customers try to login from the homepage without any merchandise in the shopping cart, then error will ocurr with a blank page and refreshing this blank page will direct the customer to the account page and not the page where they come from. It seems that the following statement in login page header_php.php is not processed correctly in php 5.4, at least in my site.

$origin_href = zen_href_link($_SESSION['navigation']->snapshot['page'], zen_array_to_string($_SESSION['navigation']->snapshot['get'], array(zen_session_name())), $_SESSION['navigation']->snapshot['mode']);  

There is nothing to do with seo, at least from what I observed. Since disable seo, the same problem occurs

4 Dec 2013, 10:31 PM
#28
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

kagaroo:

... If customers have some merchandise in the shopping cart, then there is no problem to login and the page will be directed to shopping cart page again. However, if customers try to login from the homepage without any merchandise in the shopping cart, then error will ocurr with a blank page and refreshing this blank page will direct the customer to the account page and not the page where they come from. ...
I've been running Zen Cart 1.5.1 w/ USU for a few months on a hosted site running Apache2 / PHP 5.4.22 / MySQL 5.5.30. I also have test environments on Apache2 / PHP 5.4.4 / MySQL 5.5.31 and Apache2 / PHP 5.4.12 / MySQL 5.5.28 running Zen Cart 1.5.1 w/ USU... I have not yet applied the "sessions patch" to any of them...

Have not received any memory size exhausted messages yet... Tried the steps posted by lat9... Tried also making sure I was logged out, going to a product page (adds the snapshot), and finally a login (triggers that line of code). I am unable to duplicate the error on any of the above mentioned sites... :-(

Can you post the Web Server / PHP / MySQL versions on your hosting provider? Your settings for "configuration" -> "sessions" (I have all still at out of box settings - except the live site which has force cookies enabled)? The settings for PHP "sessions" (found in the Zen Cart Administrative interface under "version" for PHP)? Hosting Provider? Any caching being done by the hosting provider?

Hoping we might see a pattern for those still experiencing this issue...

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

5 Dec 2013, 5:38 PM
#29
kagaroo avatar

kagaroo

New Zenner

Join Date:
Nov 2013
Location:
New York
Posts:
30
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Hi, Ihungil, thank you for your time. I was just frustrated after switched to php 5.4. Here is the info you asked:

MySQL 5.5.34
PHP Version: 5.4.20
HTTP Server: Apache
Server OS: Linux 2.6.32
Provider:Bluehost

session setting in php version (just master value)

session.auto_start Off
session.cache_expire 180
session.cache_limiter nocache
session.cookie_domain no value
session.cookie_httponly Off
session.cookie_lifetime 0
session.cookie_path /
session.cookie_secure Off
session.entropy_file /dev/urandom
session.entropy_length 0
session.gc_divisor 1000
session.gc_maxlifetime 1440
session.gc_probability 1
session.hash_bits_per_character 5
session.hash_function 1
session.name PHPSESSID
session.referer_check no value
session.save_handler files
session.save_path /tmp
session.serialize_handler php
session.upload_progress.cleanup On
session.upload_progress.enabled On
session.upload_progress.freq 1%
session.upload_progress.min_freq 1
session.upload_progress.name PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix upload_progress_
session.use_cookies On
session.use_only_cookies On
session.use_trans_sid 0

session setting in admin:

Session Directory /home2/zzzzz/public_html/cache
Cookie Domain True
Force Cookie Use False
Check SSL Session ID False
Check User Agent False
Check IP Address False
Prevent Spider Sessions True
Recreate Session True
IP to Host Conversion Status true
Use root path for cookie path False
Add period prefix to cookie domain True

5 Dec 2013, 5:58 PM
#30
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,114
Plugin Contributions:
56

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Here's the configuration for the installation that was failing:

PHP: 5.4.21
MySQL: 5.1.72
Server OS: Linux 2.6.28.8-20120713a-iscsi-ntacker-3ware-sec8-fmon-igb-dif2-grsec
HTTP Server: Apache
Provider: 1and1

session
Session Support 	enabled
Registered save handlers 	files user sqlite
Registered serializer handlers 	php php_binary wddx

Directive	Local Value	Master Value
session.auto_start	Off	Off
session.cache_expire	180	180
session.cache_limiter	nocache	nocache
session.cookie_domain	.mystore.com	no value
session.cookie_httponly	On	Off
session.cookie_lifetime	0	0
session.cookie_path	/myadmin	/
session.cookie_secure	Off	Off
session.entropy_file	/dev/urandom	/dev/urandom
session.entropy_length	32	32
session.gc_divisor	2	100
session.gc_maxlifetime	900	1440
session.gc_probability	1	1
session.hash_bits_per_character	4	4
session.hash_function	0	0
session.name	zenAdminID	PHPSESSID
session.referer_check	no value	no value
session.save_handler	user	files
session.save_path	/mystore/cache	/tmp
session.serialize_handler	php	php
session.upload_progress.cleanup	On	On
session.upload_progress.enabled	On	On
session.upload_progress.freq	1%	1%
session.upload_progress.min_freq	1	1
session.upload_progress.name	PHP_SESSION_UPLOAD_PROGRESS	PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix	upload_progress_	upload_progress_
session.use_cookies	On	On
session.use_only_cookies	On	On
session.use_trans_sid	0	0
Session Directory 	/mystore/cache 	 
Cookie Domain 	True
Force Cookie Use 	False
Check SSL Session ID 	False
Check User Agent 	False
Check IP Address 	False
Prevent Spider Sessions 	True
Recreate Session 	True
IP to Host Conversion Status 	true
Use root path for cookie path 	False
Add period prefix to cookie domain 	True
5 Dec 2013, 11:00 PM
#31
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Nothing jumping out to me :(

Server1 OS: Linux 2.6.32-358.18.1.el6.x86_64
Server2 OS: Linux 3.2.0-2-amd64

Both have the same settings for PHP sessions (other then default session.save_path)

Session Support 	enabled
Registered save handlers 	files user mm
Registered serializer handlers 	php php_binary wddx

Directive	Local Value	Master Value
session.auto_start	Off	Off
session.cache_expire	180	180
session.cache_limiter	nocache	nocache
session.cookie_domain	.mystore.com	no value
session.cookie_httponly	On	Off
session.cookie_lifetime	0	0
session.cookie_path	/myadmin	/
session.cookie_secure	Off	Off
session.entropy_file	/dev/urandom	/dev/urandom
session.entropy_length	32	32
session.gc_divisor	2	1000
session.gc_maxlifetime	900	1440
session.gc_probability	1	0
session.hash_bits_per_character	5	5
session.hash_function	0	0
session.name	zenAdminID	PHPSESSID
session.referer_check	no value	no value
session.save_handler	user	files
session.save_path	/home/user/cache	/tmp
session.serialize_handler	php	php
session.upload_progress.cleanup	On	On
session.upload_progress.enabled	On	On
session.upload_progress.freq	1%	1%
session.upload_progress.min_freq	1	1
session.upload_progress.name	PHP_SESSION_UPLOAD_PROGRESS	PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix	upload_progress_	upload_progress_
session.use_cookies	On	On
session.use_only_cookies	On	On
session.use_trans_sid	0	0

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

6 Dec 2013, 5:28 AM
#32
kagaroo avatar

kagaroo

New Zenner

Join Date:
Nov 2013
Location:
New York
Posts:
30
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Not supprise. I have a fresh installed zc1.51 under php5.4 in the same server with no issue. It is not the setting of the server, it is the code which causing the problem. We just don't know which custom code can triger this type error and would like inside person help us to pinpoint the problem.

9 Dec 2013, 12:21 AM
#33
kagaroo avatar

kagaroo

New Zenner

Join Date:
Nov 2013
Location:
New York
Posts:
30
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

I just read the requirement for zc 1.51.

Zen Cart v1.5.1 is compatible with PHP 5.2.14 thru PHP 5.3.x. Requires some patches to work with PHP 5.4.

Can anyone point to me which patch it refers to? Thanks!

9 Dec 2013, 3:06 PM
#34
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,853
Plugin Contributions:
18

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

Don't know where you read that. Quoting the requirements from the docs folder in a 1.5.1 release.

Minimum Server Requirements:

    • PHP 5.2.14 or higher, Apache 2.0 or higher, and MySQL 4.1.3 or higher.
    • Apache must be configured with AllowOverride set to either 'All' or at least both 'Limit' and 'Indexes' parameters, and preferably the 'Options' parameter as well.
    • PHP must be configured to support CURL with OpenSSL

RECOMMENDED server capabilities:

  • PHP 5.3.5 or higher
  • Apache 2.0 or higher
  • MySQL 5.0.90 or higher
  • and the Apache/PHP configuration settings mentioned above.

While Zen Cart® can run on Windows/IIS servers, Linux/Apache servers are recommended for best results.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

10 Dec 2013, 9:05 AM
#36
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

kagaroo:

Just fresh install zc 1.51 version on my server and test as frank18 suggested. Yes, no problem, I can log in without any problem.

For my site, it was originally for the zc 1.38 and recently upgraded to zc 1.51. It was running smoothly on php 5.2 or 5.3. but not on php5.4.......

I am suspecting that you still have some "left overs" from zc 1.3.8 in your upgraded zc 1.5.1 installation. The fact that you had no memory problems with a vanilla 1.5.1 install on the same server seems to confirm that theory.

Somehow somewhere your upgraded install is running into a loop which exhausts your memory - no matter how high you set the limit.

Do a thorough check of your file system or do a brand new re-build of your site with 1.5.1 which contains no traces of 1.3.8 code. Alternatively you could hire someone to do this job for you.

Cheers/Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

10 Dec 2013, 12:53 PM
#37
kagaroo avatar

kagaroo

New Zenner

Join Date:
Nov 2013
Location:
New York
Posts:
30
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

The problem was solved when I chose "$add_session_id=false" in both seo.url.php and html_output.php. The insteresting thing is that the freshly installed zc 1.51 could work even when "$add_session_id=true" was chosen.

Is there any problem if I chose "$add_session_id=false"?

10 Dec 2013, 2:13 PM
#38
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

kagaroo:

The problem was solved when I chose "$add_session_id=false" in both seo.url.php and html_output.php. The insteresting thing is that the freshly installed zc 1.51 could work even when "$add_session_id=true" was chosen.

See my post above:

I am suspecting that you still have some "left overs" from zc 1.3.8 in your upgraded zc 1.5.1 installation.....

It would be a matter of finding these 1.3.8 remnants and eliminating that code - wherever it may be.:huh:

kagaroo:

Is there any problem if I chose "$add_session_id=false"?

I am afraid I can't assist with an answer to that question.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

12 Dec 2013, 6:34 PM
#39
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,114
Plugin Contributions:
56

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

lat9:

The log I received was```
[22-Nov-2013 13:14:55 America/New_York] PHP Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 746619897 bytes) in xxx/includes/functions/html_output.php on line 62

> ... the referenced line being the relatively innocuous
> ```
      if (defined('SID') && zen_not_null(SID)) {

Still having this issue. I don't know if use of the pre-defined constant 'SID' is part of the issue, based on the comment in this (http://www.php.net/manual/en/session.constants.php) page at php.net. My php.ini sets both session.use_cookies and session.use_only_cookies to 'On' and I have been refreshing the screen, trying to get past the login whitescreen, using FireFox 25.0.1.

25 Dec 2013, 4:16 AM
#40
gsmsalers avatar

gsmsalers

New Zenner

Join Date:
Feb 2009
Posts:
71
Plugin Contributions:
0

Re: php 5.4 fatal error, Allowed memory size of 83886080 bytes exhausted

If I make changes as you did "$add_session_id=false" then does it compromise my website security? Does it have any other side effects?
This blank screen problem really bothering me.

kagaroo:

The problem was solved when I chose "$add_session_id=false" in both seo.url.php and html_output.php. The insteresting thing is that the freshly installed zc 1.51 could work even when "$add_session_id=true" was chosen.

Is there any problem if I chose "$add_session_id=false"?