Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2007-12-04 17:00:04

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to get my sections back

And you added both maxMemUsage lines in txp_section.php?

If so, that’s strange, because if the max memory usage is 1312kB… then why does PHP try to allocate 3256321 bytes (= approx 3200kB) of memory on that other server. That does not make sense and I have no idea on how to debug that while the page fails to load.

Is this a dedicated server that you can configure/controll yourself or a shared webhost?
Is there a difference in the PHP/MySQL versions used on your Mac and on your public server?

Offline

#32 2007-12-05 08:54:44

gmorgan
Member
Registered: 2007-11-26
Posts: 42

Re: How to get my sections back

Thats the memory the page displayed. using the txp section code I entered in my last post do you mind putting in max memory code for me to check I placed it in the correct position. As for mysql and php they are both 5’s, and yes its a server running locally so yes I have full control over it, same as the mac.

Offline

#33 2007-12-05 09:30:15

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to get my sections back

I’ve added the code + extra error_log statement to the code you entered in your earlier post. Hopefully, this will show more information in the server error logs about the memory usage.

Offline

#34 2007-12-05 11:08:23

gmorgan
Member
Registered: 2007-11-26
Posts: 42

Re: How to get my sections back

So, am I now entering this on my local mac or on the server, I entered on my local mac and it threw up

Parse error: syntax error, unexpected T_STRING in /Applications/MAMP/htdocs/textpattern/include/txp_section.php on line 14

BTW Thanks so much for you help, this is my first site in txp.

Offline

#35 2007-12-05 11:43:00

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to get my sections back

Oops, move the error_log line below the extract line.

Offline

#36 2007-12-05 13:19:53

gmorgan
Member
Registered: 2007-11-26
Posts: 42

Re: How to get my sections back

I did what you said and its still throwing up parsing errors. My php skills are a bit rusty sorry.

[php code removed]

Last edited by ruud (2007-12-05 13:24:56)

Offline

#37 2007-12-05 13:26:10

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to get my sections back

Don’t copy/paste the entire code, but edit the original txp_section.php file.
The problem is that the quotes as they were displayed here on the forum are incorrect. Look at your earlier post. Add just those yellow lines to an original, unmodified txp_section.php file.

Offline

#38 2007-12-05 13:58:43

gmorgan
Member
Registered: 2007-11-26
Posts: 42

Re: How to get my sections back

<!— Memory: 4974Kb, TEST_SECTION_MEMORY_USAGE —>

Now we’re getting some where, your a legend!

Offline

#39 2007-12-05 14:41:53

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to get my sections back

Is that on your Mac or on the other server where the problem occurs… because if this shows up, I’d expect the sections to show as well?

Offline

#40 2007-12-05 15:34:08

gmorgan
Member
Registered: 2007-11-26
Posts: 42

Re: How to get my sections back

on my mac i’ve tried it on the server and it loads up blank with nothing in the page source

Offline

#41 2007-12-05 18:30:50

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to get my sections back

Okay, on the problem server, look at the error logs. The error_log statement is in the loop that processes each section on the section tab. Ideally you should see one or more lines that show the memory usage as each section is processed. If not, put the error_log line higher up in the code (but below the line function sec_section_list) until it starts to show up in the error logs. Hopefully we can use that to pinpoint where the section tab tries to get so much memory.

Offline

#42 2007-12-06 09:01:56

gmorgan
Member
Registered: 2007-11-26
Posts: 42

Re: How to get my sections back

This is what the error log is giving, mind why is it saying event=page when I thought the issue was with even=section. I’m puzzled.
[Thu Dec 06 09:57:32 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page
[Thu Dec 06 09:57:32 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page
[Thu Dec 06 09:57:32 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page
[Thu Dec 06 09:57:32 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page
[Thu Dec 06 09:58:11 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page
[Thu Dec 06 09:58:12 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page
[Thu Dec 06 09:58:12 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page
[Thu Dec 06 09:58:12 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page
[Thu Dec 06 09:58:12 2007] [error] [client 194.82.216.174] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3262465 bytes) in Unknown on line 0, referer: http://194.82.216.4:8080/textpattern/?event=page

Offline

#43 2007-12-06 09:16:45

gmorgan
Member
Registered: 2007-11-26
Posts: 42

Re: How to get my sections back

Thanks so much for your help, I’ve just increased the php.ini max memory to 48m it was set to jut 8m as the page needs 32m. I did this last week but only restarted apache. I didnt restart the server. As your diagnostics have proven there was something wrong with memory I thought lets try restarting the server this time, and the section page has now loaded fine. How much memory should I give php, shall I give it a couple hundred megs or so.

Thanks so much for your help its been awesome.

Offline

#44 2007-12-06 09:32:59

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: How to get my sections back

gmorgan wrote:

…How much memory should I give php, shall I give it a couple hundred megs or so…

I’d go for as little as gets the job done — and then just a bit more. Check out phpsec.org for their info on php memory limits.

Just seems plain strange that an 8Meg limit on the Mac renders but you need a 32Meg limit on Windows.


Steve

Offline

#45 2007-12-11 03:23:27

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How to get my sections back

That’s interesting Steve. The “recommended” ini that comes with PHP5 for Windows uses 128M, while PHP4’s has 8M.

Offline

Board footer

Powered by FluxBB