Smarty( Fatal error: require() [function.require] )

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by AsianX, Apr 20, 2009.

  1. AsianX

    AsianX New Member

    2 errors I know of, not saying there isnt more..

    I believe this to be an issue with the chat files, its the only place I see errors and the chat is recently added( not working as of yet ).
    First error shows in the frame where the chat is supposed to display. "fpchat" is the directory the chat files are in. I dont see a file listed after that its referring to.

    Fatal error: require() [function.require]: Failed opening required './include/smarty/Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/XXX/public_html/fpchat') in /home/XXX/public_html/include/smarty/smarty_config.php on line 13

    the smarty config file is:
    Code:
    <?php 
    if($folder == "base") { 
    $serverpath = "."; 
    } else { 
    $serverpath = ".."; 
    } 
    // SPECIFY PATHS TO SMARTY RESOURCES 
    $smartypath_template_dir = realpath("$serverpath/templates"); 
    $smartypath_compile_dir = realpath("$serverpath/include/smarty/templates_c"); 
    $smartypath_cache_dir = realpath("$serverpath/include/smarty/cache"); 
    $smartypath_config_dir = realpath("$serverpath/include/smarty/configs"); 
    // INITIATE SMARTY CLASS 
    require("$serverpath/include/smarty/Smarty.class.php"); 
    $smarty = new Smarty(); 
    // ASSIGN SMARTY TEMPLATE DIRECTORY PATHS 
    $smarty->template_dir = $smartypath_template_dir; 
    $smarty->compile_dir = $smartypath_compile_dir; 
    $smarty->cache_dir = $smartypath_cache_dir; 
    $smarty->config_dir = $smartypath_config_dir; 
    ?>
    obviously an issue with the path ( no idea where to begin )

    on debug of the chat tpl .. this errror was displayed.

    Code:
    assigned template variables{$database}     Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 21749 bytes) in /home/XXX/public_html/include/smarty/plugins/modifier.debug_print_var.php on line 36
    Any information you may need that I forgot to list, please ask. Ive been trying to get a working chat(this is userplane btw) for well over 2 months, on n off. Frustrating to say the least. Any help would be appreciated.
    Thanks
  2. mfurqanabid

    mfurqanabid New Member

    Use this


    <?php
    $serverpath =$_SERVER["DOCUMENT_ROOT"] . "/";
    // INITIATE SMARTY CLASS
    require($serverpath . "include/smarty/Smarty.class.php");
    $smarty = new Smarty();
    // ASSIGN SMARTY TEMPLATE DIRECTORY PATHS
    $smarty->template_dir = $serverpath . "templates";
    $smarty->compile_dir = $serverpath . "templates_c";
    $smarty->cache_dir = $serverpath . "cache";
    $smarty->config_dir =$serverpath . "config";
    ?>

    Or View it online here http://www.smarty.net/manual/en/installing.smarty.basic.php

Share This Page