need help PLEASE READ

Discussion in 'PHP' started by jpinheiro, Aug 2, 2008.

  1. #1
    I keep Getting This Error on my site but i dont know what it means


    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/local/lib/php/./templates/tmpl1//./templates/tmpl1/index.tpl.html) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /home/a2438169/public_html/cynscriptz/buy/smarty/core/core.get_include_path.php on line 34

    Click The Link in my sig Below to see website

    Any help apreciated
     
    jpinheiro, Aug 2, 2008 IP
  2. santoshshinde

    santoshshinde Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    May be file is missing.

     
    santoshshinde, Aug 2, 2008 IP
  3. jpinheiro

    jpinheiro Peon

    Messages:
    1,211
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    0
    #3
    No because that is the MAIN template file i tried removing it and all it did was make the page go blank
     
    jpinheiro, Aug 2, 2008 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    file_exists() is meant to PREVENT these errors. It'll return TRUE if the file exists, and FALSE if not. And I don't think you ever read the error message, did you?

    Read this:
    http://www.php.net/features.safe-mode#ini.open-basedir
     
    nico_swd, Aug 2, 2008 IP
  5. jpinheiro

    jpinheiro Peon

    Messages:
    1,211
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    0
    #5
    i am a little confused on how to fix?

    do i have to use the chdir() command instead of open_basedir


    This is the File that is Erroring:


    <?php
    /**
     * Smarty plugin
     * @package Smarty
     * @subpackage plugins
     */
    
    /**
     * Get path to file from include_path
     *
     * @param string $file_path
     * @param string $new_file_path
     * @return boolean
     * @staticvar array|null
     */
    
    //  $file_path, &$new_file_path
    
    function smarty_core_get_include_path(&$params, &$smarty)
    {
        static $_path_array = null;
    
        if(!isset($_path_array)) {
            $_ini_include_path = ini_get('include_path');
    
            if(strstr($_ini_include_path,';')) {
                // windows pathnames
                $_path_array = explode(';',$_ini_include_path);
            } else {
                $_path_array = explode(':',$_ini_include_path);
            }
        }
        foreach ($_path_array as $_include_path) {
            if (file_exists($_include_path . DIRECTORY_SEPARATOR . $params['file_path'])) {
                   $params['new_file_path'] = $_include_path . DIRECTORY_SEPARATOR . $params['file_path'];
                return true;
            }
        }
        return false;
    }
    
    /* vim: set expandtab: */
    
    ?>
    PHP:
     
    jpinheiro, Aug 2, 2008 IP
  6. jpinheiro

    jpinheiro Peon

    Messages:
    1,211
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    0
    #6
    is there any1 who can help?
     
    jpinheiro, Aug 2, 2008 IP
  7. jpinheiro

    jpinheiro Peon

    Messages:
    1,211
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    0
    #7
    this is the Line of code that it says is erroring

     if (file_exists($_include_path . DIRECTORY_SEPARATOR . $params['file_path'])) {
    PHP:
     
    jpinheiro, Aug 2, 2008 IP
  8. Hallent

    Hallent Peon

    Messages:
    65
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    im looking over now
     
    Hallent, Aug 2, 2008 IP
  9. Hallent

    Hallent Peon

    Messages:
    65
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    this cant be proper paths:
    /usr/local/lib/php/./templates/tmpl1//./templates/tmpl1/index.tpl.html

    login and ls /usr/local/lib/php/./templates/tmpl1//./templates/tmpl1/index.tpl.html see if it returns anything which i dont think it will, there is a problem with permissions.

    Other wise your path settings are off and will need to set proper path.

    locate the file and the command pwd will output the path you are in

    (commands are assuming this is a linux/bsd machine)
     
    Hallent, Aug 2, 2008 IP