Page Manager doesn't save

General questions about CMSimple
delboy
Posts: 7
Joined: Mon Jun 24, 2013 9:29 am

Page Manager doesn't save

Post by delboy » Mon Jun 24, 2013 9:43 am

I have only recently discovered CMSimple and have been using it for just a few weeks. It is a brilliant programme and I am now transferring my existing site on to it. However, I have hit a problem and could use some help please. I am using version 4.1.5.

Everything was working fine until yesterday. I added new pages through the Page Manager with no problem. When I came back about an hour later to add more pages, on trying to save all I got was a blank page. I tried logging off, rebooting, different browsers all to no effect. This morning I have tried deleting the Page Manager folder from my site and uploading the original folder but still no change. Can anyone please help.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Page Manager doesn't save

Post by cmb » Mon Jun 24, 2013 10:00 am

You may enable debug mode -- it might give a hint on what's wrong.
Christoph M. Becker – Plugins for CMSimple_XH

delboy
Posts: 7
Joined: Mon Jun 24, 2013 9:29 am

Re: Page Manager doesn't save

Post by delboy » Mon Jun 24, 2013 11:07 am

Many thanks cmb. Did what you suggested and discovered the disabled_plugin.txt file was missing. I have reloaded that file and tried again. It is still not working but I now get the following error message:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 41 bytes) in /tier-11/pwpstore2/50/ratestsite/htdocs/content/pagedata.php on line 13256
Any ideas as what to do next.
Thank you.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Page Manager doesn't save

Post by cmb » Mon Jun 24, 2013 11:33 am

delboy wrote:Fatal error: Allowed memory size of 8388608 bytes exhausted
Hmm, the problem is, that on your server the memory limit is very low (only about 8 MByte). You should increase this setting which might be possible in the control panel of your webspace. If not, you may try the following file .htaccess and put it in your web root:

Code: Select all

php_value memory_limit 64M
. You can check if this setting is accepted under Settings->Info->PHP-Info->memory_limit.

If it doesn't work, you have to contact to provider to increase the memory limit for your webspace (64M are probably not necessary, but it is not very much nowadays, anyway).
Christoph M. Becker – Plugins for CMSimple_XH

delboy
Posts: 7
Joined: Mon Jun 24, 2013 9:29 am

Re: Page Manager doesn't save

Post by delboy » Mon Jun 24, 2013 11:38 am

Many thanks cmb, much appreciated. I will look into this, thanks

delboy
Posts: 7
Joined: Mon Jun 24, 2013 9:29 am

Re: Page Manager doesn't save

Post by delboy » Tue Jun 25, 2013 3:18 pm

Still not resolved but I do have a much better understanding of what is going on. Can any one tell me if the number of pages in total, created in page manager will effect the amount of memory used. I am not sure if there is a fault in my site that might be causing page manger to loop data and fill the memory or if it is that I have created too many pages.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Page Manager doesn't save

Post by cmb » Tue Jun 25, 2013 4:07 pm

delboy wrote:Can any one tell me if the number of pages in total, created in page manager will effect the amount of memory used.
The number of pages in total (indepent on whether they were created lately with Pagemanager_XH) will affect the amount of memory used for the complete execution time of the script. Unfortunately Pagamanager_XH uses several global variables, which will not be freed until the script finishes (bad design, that I'll have to fix) . That sums up with other global variables which are introduced by the core, pluginloader and other plugins, and the local variables of the functions that are currently processed (and, of course, the PHP code itself). So this is easily going to require quite some memory.

I suppose you have created too many pages for the very low memory_limit. Until a few months ago I had a memory_limit of 16 MB on my site, and never noticed any problems. I'll make some tests later to actually check the memory usage.
delboy wrote:Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 41 bytes) in /tier-11/pwpstore2/50/ratestsite/htdocs/content/pagedata.php on line 13256
Well, I only had concentrated on the first part of the error message, and ignored the second one. Obviously your pagedata.php has more than 13256 lines! For the standard installation of CMSimple_XH a pagedata record has 16 lines (this may increase with additional plugins), so it seems you have several hundred pages! What's the size of your content.htm and pagedata.php?
Christoph M. Becker – Plugins for CMSimple_XH

delboy
Posts: 7
Joined: Mon Jun 24, 2013 9:29 am

Re: Page Manager doesn't save

Post by delboy » Tue Jun 25, 2013 5:41 pm

Yes I do have hundreds of pages on the site but most contain just a small amount of text so the total content is just under 20 meg of an allowed 200 meg.

Pagedata.php is 489Kb and the content.htm is 986Kb.

The site can be found at http://ratestsite.webspace.virginmedia.com/. I really appreciate your taking the time to try and help me with this.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Page Manager doesn't save

Post by cmb » Tue Jun 25, 2013 7:00 pm

cmb wrote: I'll make some tests later to actually check the memory usage.
I have installed a fresh CMSimple_XH 1.5.7 on my PHP 5.4.7. With the default content (17 pages) browsing the front-end uses at most about 1.2 MB; in the back-end this is slightly increased to 1.3 MB (saving from Pagemanager doesn't make a noticeable difference). A generated content (400 relatively large pages; content.htm 2.5 MB; pagedata.php 206 KB) required about 10-11 MB when browsing the front-end; for the back-end the same amount of memory is needed. Calling "Pages" required nearly 15 MB[1], while saving from Pagemanager required only 11 MB. A generated content (1110 relatively small pages; content.htm 2 MB; pagedata.php 0.6 MB) required 9.5 MB in the front-end and for typical actions in the back-end, more than 14MB for calling the pagemanager and about 10 MB on saving from the pagemanger.

So I'm a bit puzzled, why the memory limit strikes on your server, when you save the pages from the page manager. In my test environment I wouldn't have been able to call the page manager at all with a low memory limit. However, there are many variables which may influence the memory usage, for instance the version of PHP (the cyclic garbage collector was introduced only in 5.3; I'm not sure, however, if it does make a huge difference here, as there may no cycles be involved).

I've just seen your new post. The link to the website explains the very low memory_limit (I suppose it's a free webspace); I'm quite buffled, however, to read that the site is powered by PHP 4.3.11; I had thought that every provider had at least switched to PHP 4.4.19... [2]
delboy wrote:Yes I do have hundreds of pages on the site
According to the sitemap 753 (plus maybe some hidden pages). The size of pagedata.php on disk is under 1MB, but the memory requirement when built as a two-dimensional array is quite likely to be higher. Each value in a PHP requires quite some memory; in a standard built of PHP 5.3 on a 64bit Linux machine, exactly 144 byte. Each standard page data record hold 14 values, so each record takes about 2 KB. You have 753 pages, so the complete page data array takes about 1.6 MB, which will be held in memory for the duration of the script. When saving the page data the complete file content is built in memory before it is saved; that would need another MB. And obviously this is too much, as other data have to be stored in memory as well.

Possible solutions:
  • Reduce the number of pages by joining related information on a single page. E.g. the "Field Regiments" -> "Regts 1-50" may all go on the same page (or perhaps in groups of 10 distributed on 5 pages). This will reduce the number of pages, and so reduce the memory used by the page data (and some other arrays, which store page information).
  • Uninstall the page_params and/or meta_tags plugins and delete pagedata.php (make a backup before!). If needed, you can have the functionality via classic CMSimple scripting. This should reduce the in memory size of the page data array to about 320 KB, what may already be enough.
[1] That's most likely due to the fact, that the pagemanager has to read content.htm again to cater for potentially missing information (the original page headings may have been altered by CMSimple).

[2] PHP 4.4 was released nearly 8 (!) years ago. CMSimple 4.2 and CMSimple_XH 1.5.7 require PHP 4.3 and CMSimple_XH 1.6 will probably require PHP 4.3.10. If it's for me, the version after XH 1.6 will push the requirements to at least PHP 5.
Christoph M. Becker – Plugins for CMSimple_XH

delboy
Posts: 7
Joined: Mon Jun 24, 2013 9:29 am

Re: Page Manager doesn't save

Post by delboy » Wed Jun 26, 2013 6:52 am

Thanks for the help, I removed the files you suggested and page manager is now working again. When I checked the files in the Content folder I found duplicate content and pagedata files with number blocks in the name - e.g. 20130530_132355_content and the same for pagedata. There were 4 pairs of these with different numbers, all the same size as the content and pagedata files. I deleted these first but it made no difference. I then deleted page_params, Meta_tags and pagedata.php and it now works.

I have noticed that my deleted pagedata.php file size was 500,461 and the new file with one new page added is now 124,433. Should those duplicate files have been there.

Post Reply