Could someone take a look at my site and tell me what is wrong? I think it is PHP.

Discussion in 'HTML & Website Design' started by Imozeb, Mar 13, 2012.

  1. #1
    Last edited: Mar 13, 2012
    Imozeb, Mar 13, 2012 IP
  2. ApocalypseXL

    ApocalypseXL Notable Member

    Messages:
    6,095
    Likes Received:
    103
    Best Answers:
    5
    Trophy Points:
    240
    #2
    There is no website and even if it was we can't see the dam PHP because it's server side .
     
    ApocalypseXL, Mar 14, 2012 IP
  3. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Imozeb, Mar 14, 2012 IP
  4. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #4
    Well, it clearly says what the error is --> is not within the allowed path. Change it so it actually is in a allowed path

    Well, it can't open it, probably because not within the allowed path...
     
    GMF, Mar 14, 2012 IP
  5. VPSVolt

    VPSVolt Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You need to get 000webhost to enable open_basedir in there php.ini. I think this may be the issue here. I don't think they will though. Especially considering they are a free webhost.

    Thanks, VPSVolt.
     
    VPSVolt, Mar 14, 2012 IP
  6. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Do I have to ask them or can I do it manuelly?
     
    Imozeb, Mar 14, 2012 IP
  7. gamezfever

    gamezfever Member

    Messages:
    48
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #7
    it looked free account? you can either use free cpanel hosting with all features includes cgi access and much more
    May be it will solved your problem.
     
    gamezfever, Mar 14, 2012 IP
  8. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Where can I get free cpanel hosting with all features like enable open_basedir in there php.ini
     
    Imozeb, Mar 14, 2012 IP
  9. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    So, how do I change enable open_basedir in my php.ini

    Can I do it via .htaccess file?
     
    Imozeb, Mar 14, 2012 IP
  10. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I emailed them about open_basedir and they said:

    The PHP open_basedir feature is enabled by default and can not be disabled for
    security reasons.

    So I guess it is not that the open_basedir is disabled. Any other ideas?

    Please help! Tell me if you need any more information.

    This is a link to my sites PHP info: http://thethoughttreasury.host56.com/test.php



    Someone said I should change:

    In your class.Cache.php file, there might be a code defining your document root. The document
    root defined in php configuration is '/usr/local/apache/htdocs', while your actual document root
    is '/home/account#/public_html' directory. So, you need to change your code something like:

    From:
    $doc_root= $_SERVER['DOCUMENT_ROOT'];

    To:
    $doc_root = dirname(_FILE_);



    Is this right? If so what do I change in this script?

    This is my Class.cache file:

    <?php
    /************************************************** *****************
    / ProArcadeScript
    / File description:
    / Implementation of the CCache class
    /
    /************************************************** *****************/


    //-----------------------------------------------------------------------------------------
    // helper function which recursively removes a directory
    //
    // to use this function to totally remove a directory, write:
    // remove_directory('path/to/directory/to/delete');
    // to use this function to empty a directory, write:
    // remove_directory('path/to/full_directory',TRUE);
    //-----------------------------------------------------------------------------------------
    function remove_directory( $directory, $empty=FALSE )
    {
    if(substr($directory,-1) == '/')
    $directory = substr($directory,0,-1);
    if(!file_exists($directory) || !is_dir($directory))
    return FALSE;
    elseif(is_readable($directory))
    {
    $handle = opendir($directory);
    while (FALSE !== ($item = readdir($handle)))
    {
    if($item != '.' && $item != '..')
    {
    $path = $directory.'/'.$item;
    if(is_dir($path))
    remove_directory($path);
    else
    unlink($path);
    }
    }
    closedir($handle);
    if($empty == FALSE)
    if(!rmdir($directory))
    return FALSE;
    }
    return TRUE;
    }





    //-----------------------------------------------------------------------------------------
    // Class CCache
    //-----------------------------------------------------------------------------------------
    class CCache
    {
    var $ttl = 2000; // Time to leave, seconds
    var $cache_root = '';
    var $enabled = false;

    //-----------------------------------------------------------------------------------------
    function CCache()
    {
    $path = $_SERVER['DOCUMENT_ROOT'] . $GLOBALS['cSite']['sSiteRoot'] . 'cache';
    $this->ttl = $GLOBALS['cSite']['cacheTTL'];
    if( !is_dir($path) )
    {
    mkdir( $path, 0775 );
    $file = fopen( $path . '/index.html', 'w' );
    if( $file )
    {
    fwrite( $file, ' ' );
    fclose( $file );
    }
    }
    $this->cache_root = "$path/";
    $this->enabled = $GLOBALS["cSite"]["bCache"];
    }

    //-----------------------------------------------------------------------------------------
    function get()
    {
    if( !$this->enabled )
    return false;

    $name = $_SERVER['REQUEST_URI'];
    $ext = $_SESSION['user'];
    $hash = sha1($name);
    $hash_ext = sha1($ext);
    $cache_dir = substr( $hash, 0, 5 );
    $cache_subdir = substr( $hash, 5, 5 );
    $time = date( 'U' );
    $cache_file = $this->cache_root . $cache_dir . '/' . $cache_subdir . '/' . $hash . '.' . $hash_ext;
    if( file_exists($cache_file) && ($time - filemtime($cache_file) < $this->ttl) )
    {
    $file = fopen( $cache_file, 'r' );
    if( $file )
    {
    $data = fread( $file, filesize($cache_file) );
    fclose( $file );
    return unserialize( $data );
    }
    else
    return false;
    }
    else
    return false;

    }

    //-----------------------------------------------------------------------------------------
    function write( $data )
    {
    if( !$this->enabled )
    return true;

    $name = $_SERVER['REQUEST_URI'];
    $ext = $_SESSION['user'];
    $hash = sha1($name);
    $hash_ext = sha1($ext);
    $cache_dir = $this->cache_root . '/' . substr( $hash, 0, 5 );
    $cache_subdir = $cache_dir . '/' . substr( $hash, 5, 5 );
    if( !is_dir($cache_dir) )
    mkdir( $cache_dir, 0775 );
    if( !is_dir($cache_subdir) )
    mkdir( $cache_subdir, 0775 );
    $file = fopen( $cache_subdir.'/'.$hash.'.'.$hash_ext, 'w' );
    if( $file )
    {
    $res = fwrite( $file, serialize($data) );
    fclose( $file );
    return $res;
    }
    return false;
    }

    //-----------------------------------------------------------------------------------------
    function delete( $what, $id, $title )
    {
    switch( $what )
    {
    case 'game':
    $name = GameURL( $id, $title );
    $hash = sha1($name);
    $cache_dir = (substr($this->cache_root,-1) == '/') ? substr( $this->cache_root, 0, -1 ) : $this->cache_root;
    $cache_dir .= '/' . substr( $hash, 0, 5 ) . '/' . substr( $hash, 5, 5 );
    remove_directory( $cache_dir );
    break;
    case 'cat':
    $name = CategoryURL( $title );
    $hash = sha1($name);
    $cache_dir = (substr($this->cache_root,-1) == '/') ? substr( $this->cache_root, 0, -1 ) : $this->cache_root;
    $cache_dir .= '/' . substr( $hash, 0, 5 ) . '/' . substr( $hash, 5, 5 );
    remove_directory( $cache_dir );
    case 'home':
    $name = $GLOBALS['cSite']['sSiteRoot'];
    $hash = sha1($name);
    $cache_dir = (substr($this->cache_root,-1) == '/') ? substr( $this->cache_root, 0, -1 ) : $this->cache_root;
    $cache_dir .= '/' . substr( $hash, 0, 5 ) . '/' . substr( $hash, 5, 5 );
    remove_directory( $cache_dir );
    break;
    case 'page':
    $name = $GLOBALS['cSite']['sSiteRoot'] . 'docs/' . $id;
    $hash = sha1($name);
    $cache_dir = (substr($this->cache_root,-1) == '/') ? substr( $this->cache_root, 0, -1 ) : $this->cache_root;
    $cache_dir .= '/' . substr( $hash, 0, 5 ) . '/' . substr( $hash, 5, 5 );
    remove_directory( $cache_dir );
    break;
    default:
    break;
    }
    }


    //-----------------------------------------------------------------------------------------
    function clear_cache()
    {
    // empty the cache dir
    remove_directory( $this->cache_root, TRUE );
    }


    }//class


    ?>
     
    Last edited: Mar 14, 2012
    Imozeb, Mar 14, 2012 IP
  11. gamezfever

    gamezfever Member

    Messages:
    48
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #11
    gamezfever, Mar 14, 2012 IP