Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2010
    Posts
    16
    Plugin Contributions
    0

    Default Local MAMP install blank index page

    Hello! I've been searching the forums for some time now and can't find the answer to my specific dilemma.

    I downloaded a tar ball of an existing zen cart site and attempted to set it up locally for tweaking on my mac/MAMP Pro. I've replaced all instances of the site name to the local site name in the entire site folder as well as the SQL db.

    The admin part of the site works fine. It's reading the db correctly from my local SQL db. However, all other pages on the local site yield a blank page, where the page source contains absolutely nothing.

    I checked the error logs and there is nothing being logged - and I know the error logging is working because I was just using it for a different local site.

    The Zen cart install that I'm working with is 1.3.8 and I'm VERY hesitant to upgrade as there are lots of additional plug-ins and modules that the site depends on. I'm aware that 1.3.8 operates on PHP 5.2, so I have my MAMP set to just that. I ran phpinfo() on both the live site and the local site, and live = 5.2.13 and local = 5.2.14.

    Upon debugging, I'm finding that when it tries to load index.php, the scripting stops at this line on application_top.php (line 119)

    require('includes/autoload_func.php');

    Where autoload_func.php seems to stop somewhere in the first foreach loop.

    Any thoughts? I also tried the local site both with and without .htaccess files present. Same results.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Local MAMP install blank index page

    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jun 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Local MAMP install blank index page

    [11-Oct-2010 21:34:23] PHP Fatal error: Class 'notifier' not found in /Users/[myusername]/Sites/wald.new/includes/autoload_func.php on line 79

    Here is my autoload_func.php:

    Code:
    <?php
    /**
     * File contains the autoloader loop
     * 
     * The autoloader loop takes the array from the auto_loaders directory
     * and uses this this to constuct the InitSysytem. 
     * see {@link http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem} for more details.
     *
     * @package initSystem
     * @copyright Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: autoload_func.php 6559 2007-07-05 06:42:51Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    reset($autoLoadConfig);
    ksort($autoLoadConfig);
    foreach ($autoLoadConfig as $actionPoint => $row) {
      $debugOutput = "";
      foreach($row as $entry) {
        $debugOutput = 'actionPoint=>'.$actionPoint . ' ';
    //    $entry['loadFile'] = str_replace(array(':', '\\\\'), '', $entry['loadFile']);
        switch($entry['autoType']) {
          case 'include':
          /**
           * include a file as specified by autoloader array
           */
          if (file_exists($entry['loadFile'])) include($entry['loadFile']); else $debugOutput .= 'FAILED: ';
          $debugOutput .= 'include(\'' . $entry['loadFile'] . '\');' . '<br />';
          break;
          case 'require':
          /**
           * require a file as specified by autoloader array
           */
          if (file_exists($entry['loadFile'])) require($entry['loadFile']); else $debugOutput .= 'FAILED: ';
          $debugOutput .= 'require(\'' . $entry['loadFile'] . '\');' . '<br />';
          break;
          case 'init_script':
          $baseDir = DIR_WS_INCLUDES . 'init_includes/';
          if (file_exists(DIR_WS_INCLUDES . 'init_includes/overrides/' . $entry['loadFile'])) {
            $baseDir = DIR_WS_INCLUDES . 'init_includes/overrides/';
          }
          /**
           * include an init_script as specified by autoloader array
           */
          if (file_exists($baseDir . $entry['loadFile'])) include($baseDir . $entry['loadFile']); else $debugOutput .= 'FAILED: ';
          $debugOutput .= 'include(\'' . $baseDir . $entry['loadFile'] . '\');' . '<br />';
          break;
          case 'class':
          if (isset($entry['classPath'])) {
            $classPath = $entry['classPath'];
          } else {
            $classPath = DIR_FS_CATALOG . DIR_WS_CLASSES;
          }
          /**
           * include a class definition as specified by autoloader array
           */
          if (file_exists($classPath . $entry['loadFile'])) include($classPath . $entry['loadFile']); else $debugOutput .= 'FAILED: ';
          $debugOutput .= 'include(\'' . $classPath . $entry['loadFile'] . '\');' . '<br />';
          break;
          case 'classInstantiate':
          $objectName = $entry['objectName'];
          $className = $entry['className'];
          if (isset($entry['classSession']) && $entry['classSession'] === true) {
            if (isset($entry['checkInstantiated']) && $entry['checkInstantiated'] === true) {
              if (!isset($_SESSION[$objectName])) {
                $_SESSION[$objectName] = new $className();
                $debugOutput .= 'if (!$_SESSION[' . $objectName . ']) { ';
                $debugOutput .= '$_SESSION[' . $objectName . '] = new ' . $className . '();';
                $debugOutput .= ' }<br />';
              }
            } else {
              $_SESSION[$objectName] = new $className();
              $debugOutput .= '  $_SESSION[' . $objectName . '] = new ' . $className . '();<br />';
            }
          } else {
            $$objectName = new $className();
            $debugOutput .= '$' . $objectName . ' = new ' . $className . '();<br />';
          }
          break;
          case 'objectMethod':
          $objectName = $entry['objectName'];
          $methodName = $entry['methodName'];
          if (is_object($_SESSION[$objectName])) {
            $_SESSION[$objectName]->$methodName();
            $debugOutput .= '$_SESSION[' . $objectName . ']->' . $methodName . '();<br />';
          } else {
            $$objectName->$methodName();
            $debugOutput .= '$' . $objectName . '->' . $methodName . '();<br />';
          }
          break;
        }
        if (DEBUG_AUTOLOAD === true) echo $debugOutput;
      }
    }
    ?>
    In my text editor, line 79 is
    Code:
    $objectName = new $className();
    I searched the zen cart install for "class notifier" and found it in includes/config.core.php:

    Code:
    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce                                       |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003-2005 The zen-cart developers                      |
    // |                                                                      |
    // | http://www.zen-cart.com/index.php                                    |
    // |                                                                      |
    // | Portions Copyright (c) 2003 osCommerce                               |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license,       |
    // | that is bundled with this package in the file LICENSE, and is        |
    // | available through the world-wide-web at the following url:           |
    // | http://www.zen-cart.com/license/2_0.txt.                             |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to       |
    // | [email protected] so we can mail you a copy immediately.          |
    // +----------------------------------------------------------------------+
    // $Id: config.core.php 3009 2006-02-11 15:41:10Z wilt $
    //
    /**
     * autoloader array for catalog application_top.php
     *
     * @package admin
     * @copyright Copyright 2003-2005 zen-cart Development Team
    **/
    /*
    *
     
     require(DIR_WS_CLASSES . 'class.base.php'); 
     require(DIR_WS_CLASSES . 'class.notifier.php'); 
      $zco_notifier = new notifier()'
     * require(DIR_WS_CLASSES . 'sniffer.php'); 
     * require(DIR_WS_CLASSES . 'logger.php'); 
     * require(DIR_WS_CLASSES . 'shopping_cart.php'); 
     * require(DIR_WS_CLASSES . 'products.php'); 
     * require(DIR_WS_CLASSES . 'table_block.php');
     * require(DIR_WS_CLASSES . 'box.php'); 
     * require(DIR_WS_CLASSES . 'message_stack.php'); 
     * require(DIR_WS_CLASSES . 'split_page_results.php'); 
     * require(DIR_WS_CLASSES . 'object_info.php'); 
     * require(DIR_WS_CLASSES . 'class.phpmailer.php');
     * require(DIR_WS_CLASSES . 'class.smtp.php'); 
     * require(DIR_WS_CLASSES . 'upload.php'); 
     * 
    */
    
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'class.base.php');
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'class.notifier.php');
      $autoLoadConfig[0][] = array('autoType'=>'classInstantiate',
                                   'className'=>'notifier',
                                   'objectName'=>'zco_notifier');
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'sniffer.php');
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'logger.php',
                                   'classPath'=>DIR_WS_CLASSES);
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'shopping_cart.php',
                                   );
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'products.php');
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=> 'table_block.php',
                                   'classPath'=>DIR_WS_CLASSES);
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=> 'box.php',
                                   'classPath'=>DIR_WS_CLASSES);
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'message_stack.php',
                                   'classPath'=>DIR_WS_CLASSES);
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'split_page_results.php',
                                   'classPath'=>DIR_WS_CLASSES);
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'object_info.php',
                                   'classPath'=>DIR_WS_CLASSES);
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'class.phpmailer.php');
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'class.smtp.php');
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'upload.php',
                                   'classPath'=>DIR_WS_CLASSES);
    /**
     * Breakpoint 10.
     * 
     * require('includes/init_includes/init_file_db_names.php');
     * require('includes/init_includes/init_database.ph');
     * require('includes/version.php');
     * 
     */
      $autoLoadConfig[10][] = array('autoType'=>'init_script',
                                    'loadFile'=> 'init_file_db_names.php');
      $autoLoadConfig[10][] = array('autoType'=>'init_script',
                                    'loadFile'=>'init_database.php');
      $autoLoadConfig[10][] = array('autoType'=>'require',
                                    'loadFile'=> DIR_FS_CATALOG . DIR_WS_INCLUDES .  'version.php');
    /**
     * Breakpoint 20.
     * 
     * require('includes/init_includes/init_db_config_read.php');
     * 
     */
      $autoLoadConfig[20][] = array('autoType'=>'init_script',
                                    'loadFile'=> 'init_db_config_read.php');
    /**
     * Breakpoint 30.
     * 
     * require('includes/init_includes/init_gzip.php');
     * $sniffer = new sniffer();
    
     * 
     */
      $autoLoadConfig[30][] = array('autoType'=>'init_script',
                                    'loadFile'=> 'init_gzip.php');
      $autoLoadConfig[30][] = array('autoType'=>'classInstantiate',
                                    'className'=>'sniffer',
                                    'objectName'=>'sniffer');
    /**
     * Breakpoint 40.
     * 
     * require('includes/init_includes/init_general_funcs.php');
     * require('includes/init_includes/init_tlds.php');
     * 
     */
      $autoLoadConfig[40][] = array('autoType'=>'init_script',
                                    'loadFile'=> 'init_general_funcs.php');
      $autoLoadConfig[40][] = array('autoType'=>'init_script',
                                    'loadFile'=> 'init_tlds.php');
    /**
     * Breakpoint 60.
     * 
     * require('includes/init_includes/init_sessions.php');
     * 
     */
      $autoLoadConfig[60][] = array('autoType'=>'init_script',
                                    'loadFile'=> 'init_sessions.php');
    /**
     * Breakpoint 70.
     * 
     * require('includes/init_includes/init_languages.php');
     * 
     */
      $autoLoadConfig[70][] = array('autoType'=>'init_script',
                                    'loadFile'=> 'init_languages.php');
    /**
     * Breakpoint 80.
     * 
     * require('includes/init_includes/init_templates.php');
     * 
     */
      $autoLoadConfig[80][] = array('autoType'=>'init_script',
                                    'loadFile'=> 'init_templates.php');
    /**
     * Breakpoint 90.
     * 
     * $zc_products = new products();
     * require(DIRWS_FUNCTIONS . 'localization.php');
     * require(DIRWS_FUNCTIONS . 'validations.php');
     * 
     */
      $autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
                                    'className'=>'products',
                                    'objectName'=>'zc_products');
      $autoLoadConfig[90][] = array('autoType'=>'require',
                                     'loadFile'=> DIR_WS_FUNCTIONS . 'localization.php');
    /**
     * Breakpoint 100.
     * 
     * $messageStack = new messageStack();
     * 
     */
      $autoLoadConfig[100][] = array('autoType'=>'classInstantiate',
                                    'classPath'=>DIR_WS_CLASSES,
                                     'className'=>'messageStack',
                                     'objectName'=>'messageStack');
    /**
     * Breakpoint 120.
     * 
     * require('includes/init_includes/init_special_funcs.php');
     * 
     */
      $autoLoadConfig[120][] = array('autoType'=>'init_script',
                                     'loadFile'=> 'init_special_funcs.php');
    
    /**
     * Breakpoint 130.
     * 
     * require('includes/init_includes/init_category_path.php');
     * 
     */
      $autoLoadConfig[130][] = array('autoType'=>'init_script',
                                     'loadFile'=> 'init_category_path.php');
    /**
     * Breakpoint 140.
     * 
     * require('includes/init_includes/init_errors.php');
     * 
     */
      $autoLoadConfig[140][] = array('autoType'=>'init_script',
                                     'loadFile'=> 'init_errors.php');
    /**
     * Breakpoint 150.
     * 
     * require('includes/init_includes/init_admin_auth.php');
     * 
     */
      $autoLoadConfig[150][] = array('autoType'=>'init_script',
                                     'loadFile'=> 'init_admin_auth.php');
    /**
     * Breakpoint 160.
     * 
     * require(DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'audience.php');
     * 
     */
      $autoLoadConfig[160][] = array('autoType'=>'require',
                                     'loadFile'=> DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'audience.php');
    /**
     * Breakpoint 170.
     * 
     * require('includes/init_includes/init_admin_history.php');
     * 
     */
      $autoLoadConfig[170][] = array('autoType'=>'init_script',
                                     'loadFile'=> 'init_admin_history.php');
    /**
     * Breakpoint 180.
     * 
     * require('includes/init_includes/init_html_editor.php);
     * 
     */
    
      $autoLoadConfig[180][] = array('autoType'=>'init_script',
                                     'loadFile'=> 'init_html_editor.php');
    ?>
    I noticed the class requirement was commented out, so I uncommented it and class.base and got this error log:

    Code:
    [11-Oct-2010 22:27:53] PHP Warning:  require(includes/classes/mime.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /Users/[myusername]/Sites/wald.new/includes/auto_loaders/config.core.php on line 19
    [11-Oct-2010 22:27:53] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/classes/mime.php' (include_path='.:/Applications/MAMP/bin/php5.2/lib/php') in /Users/[myusername]/Sites/wald.new/includes/auto_loaders/config.core.php on line 19
    I also found this thread http://www.zen-cart.com/forum/showthread.php?p=320867 and discovered that my session.auto_start value was already set to 0.

    Thanks you for any help!

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Local MAMP install blank index page

    Quote Originally Posted by larf2k View Post
    [11-Oct-2010 21:34:23] PHP Fatal error: Class 'notifier' not found in /Users/[myusername]/Sites/wald.new/includes/autoload_func.php on line 79
    In the purest sense, the error message means exactly what it says: "Class 'notifier' not found".
    And, that means that the notifier class file is either missing, or damaged or otherwise not being loaded properly.

    Quote Originally Posted by larf2k View Post
    Here is my autoload_func.php:
    The error message only mentions that file because that's the file that *discovered* the problem, not *where* the problem originates.
    Quote Originally Posted by larf2k View Post
    In my text editor, line 79 is
    Code:
    $objectName = new $className();
    Moot.
    Quote Originally Posted by larf2k View Post
    I searched the zen cart install for "class notifier" and found it in includes/config.core.php:
    Yes, it's mentioned there, and indeed it's loaded from there, but not via a "require" statement as you suppose.
    It's actually loaded by this:
    Code:
      $autoLoadConfig[0][] = array('autoType'=>'class',
                                   'loadFile'=>'class.notifier.php');
      $autoLoadConfig[0][] = array('autoType'=>'classInstantiate',
                                   'className'=>'notifier',
                                   'objectName'=>'zco_notifier');
    Quote Originally Posted by larf2k View Post
    I noticed the class requirement was commented out, so I uncommented it and class.base and got this error log:

    Code:
    [11-Oct-2010 22:27:53] PHP Warning:  require(includes/classes/mime.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /Users/[myusername]/Sites/wald.new/includes/auto_loaders/config.core.php on line 19
    [11-Oct-2010 22:27:53] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/classes/mime.php' (include_path='.:/Applications/MAMP/bin/php5.2/lib/php') in /Users/[myusername]/Sites/wald.new/includes/auto_loaders/config.core.php on line 19
    I'm not surprised that uncommenting any of the "require" statements there would cause a problem ... because they're there as comments only.


    So ... back to the real issue:
    The most likely cause of your problem is that you're missing at least one file from /includes/classes ... and if you're missing one, usually you're missing several.
    This is the fastest way to identify likely issues: http://www.zen-cart.com/wiki/index.p...Obscure_Issues

    You can find the original set of Zen Cart files for all versions at SourceForge. Link is on the home-page of www.zen-cart.com


    If you find that the files are indeed all present perfectly, then edit your application_top.php file and change DEBUG_AUTOLOAD to true so the steps from the config.core execution are displayed to screen.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Local MAMP install blank index page

    UGH!

    Thanks so much! Turning on autoload debugging revealed to me that I was missing a trailing slash in my configure.php for the full path.


  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Local MAMP install blank index page

    Always best to run zc_install to build the configure.php files on a new site. Saves all kinds of wasted time troubleshooting needlessly.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v151 How to install second site on MAMP local server?
    By Dave224 in forum Installing on a Mac Server
    Replies: 2
    Last Post: 22 Oct 2016, 05:25 AM
  2. How do I make a copy of my live site to use on my local MAMP setup?
    By Treece in forum Installing on a Mac Server
    Replies: 1
    Last Post: 5 May 2011, 02:15 AM
  3. MAMP/XAMPP set up local host
    By jamesdavid in forum Installing on a Mac Server
    Replies: 46
    Last Post: 13 Aug 2010, 02:33 PM
  4. zc_install/index.php displayed when moving to Local MAMP
    By greenit in forum Installing on a Mac Server
    Replies: 1
    Last Post: 7 Aug 2010, 03:55 PM
  5. Blank index.php and /admin/index.php page after install
    By gsummerlin in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 14 Jul 2006, 10:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR