• Fatal Error#

  • stevek2011 Reply #1, 1 year ago

    Reply
    http://front.investnchina.com/vip/

    Receiving this error:
    Fatal error: Out of memory (allocated 36438016) (tried to allocate 46 bytes) in /var/www/front/vip/manager/includes/document.parser.class.inc.php on line 1240

    This is the group of code within line 1240:
    1230 $childKey= array_search($childId, $this->documentListing);
    1231 if (!$childKey) {
    1232 $childKey= "$childId";
    1233 }
    1234 $c[$childKey]= $childId;
    1235 }
    1236 }
    1237 $depth--;
    1238 if (is_array($c)) {
    1239 if (is_array($children)) {
    1240 $children= $children + $c;
    1241 } else {
    1242 $children= $c;
    1243 }
    1244 if ($depth) {
    1245 foreach ($c as $child) {
    1246 $children= $children + $this->getChildIds($child, $depth, $children);
    1247 }
    1248 }
    1249 }
    1250 return $children;


    I also get this Parser error within system reports

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: Illegal offset type in isset or empty
    Error type/ Nr.: Warning - 2
    File: /var/www/front/vip/manager/includes/document.parser.class.inc.php
    Line: 1228
    Line 1228 source: if (isset ($mapEntry[$id])) {

    Parser timing
    MySQL: 0.0023 s (3 Requests)
    PHP: 0.0278 s
    Total: 0.0301 s


    Here's the code for that group:
    1225 function getChildIds($id, $depth= 10, $children= array ()) {
    1226 $c= null;
    1227 foreach ($this->documentMap as $mapEntry) {
    1228 if (isset ($mapEntry[$id])) {
    1229 $childId= $mapEntry[$id];
    1230 $childKey= array_search($childId, $this->documentListing);
    1231 if (!$childKey) {
    1232 $childKey= "$childId";
    1233 }
    1234 $c[$childKey]= $childId;
    1235 }
    1236 }


    I'm able to remove certain lines to make the site work but drop down menus on the website become disabled. What is the problem??


  • sottwell Reply #2, 1 year ago

    Reply
    How many resources (documents) do you have?

    And that MODx version is very old, you really should upgrade to 1.0.5


  • stevek2011 Reply #3, 1 year ago

    Reply
    Based on the tree to the left, there's about 30 pages.


  • sottwell Reply #4, 1 year ago

    Reply
    Sounds like your site cache file may be corrupted. Try emptying the assets/cache/siteCache.idx.php file, then go to the Configuration tab in the Manager and save it; that will re-create the cache file.


  • stevek2011 Reply #5, 1 year ago

    Reply
    How do I empty the siteCache.idx.php? Just delete everything in that file?


  • sottwell Reply #6, 1 year ago

    Reply
    Back it up first, but yes, open it in an editor and delete the contents. It should re-create in any case, but I've found that sometimes I need to "save" the configuration to get it to be refreshed.


  • stevek2011 Reply #7, 1 year ago

    Reply
    Didn't work >


  • sottwell Reply #8, 1 year ago

    Reply
    Well, the problem occurs when it's trying to use the arrays in that file. So something is wrong with it.