The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [Solved] Parse Error installing #64 Building a Photo Gallery

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #25847

    I’m tiring to install the photo gallery that is featured on this site (#64 Building a Photo Gallery). I have all my folders and directories setup, my imgbrowz0r.php is in the inc folder, but when I try to view the page I get this message.

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/shepa0/public_html/chris/imgbrowz0r/inc/imgbrowz0r.php on line 37

    Fatal error: Cannot instantiate non-existent class: imgbrowz0r in /home/shepa0/public_html/chris/imgbrowz0r/index.php on line 65

    First off there is nothing on line 37.
    Second this is what is on like 65: $gallery = new imgbrowz0r($config);

    Here is a link to the live page:

    And hers my code. Please let me know If I have anything out of place.

    1024; $i++)
    $size /= 1024;

    return round($size, 2).’ ‘.$units[$i];

    function get_microtime($microtime=false)
    if ($microtime === false)
    $microtime = microtime();

    list($usec, $sec) = explode(‘ ‘, $microtime);
    return ((float)$usec + (float)$sec);

    $start_timer = microtime();

    // Include class
    require ‘’;

    // These are all settings (set to default). The settings are not validated since you have to configure everything.
    // There is a chance that ImgBrowz0r stops working if you enter the wrong values.
    $config = array(
    // Directory settings. These are required. Without trailing slash. (required)
    ‘images_dir’ => ‘’,
    ‘cache_dir’ => ‘’,

    ‘main_url’ => ‘’,
    ‘images_url’ => ‘’,
    ‘cache_url’ => ‘’,

    // Sorting settings (optional)
    ‘sort_by’ => 3, // 1 = filename, 2 = extension (png, gif, etc.), 3 = inode change time of file
    ‘sort_order’ => false, // true = ascending, false = descending

    // Thumbnail settings (optional)
    ‘thumbs_per_page’ => 12, // Amount of thumbnails per page
    ‘max_thumb_row’ => 4, // Amount of thumbnails on a row
    ‘max_thumb_width’ => 200, // Maximum width of thumbnail
    ‘max_thumb_height’ => 200, // Maximum height of thumbnail

    // Time settings (optional)
    ‘time_format’ => ‘F jS, Y’, // Date formatting. Look at the PHP date() for help:
    ‘time_zone’ => 0, // Timezone. Example: 1
    ‘enable_dst’ => false, // Daylight saving time (DST). Set this to true to enable it.

    // Misc settings (optional)
    ‘ignore_port’ => false, // Ignore port in url. Set this to true to ignore the port.
    ‘dir_thumbs’ => true, // Show a thumbnail in a category box. Default is false.
    ‘random_thumbs’ => false, // Use random thumbnails for categories. Default is false.
    ‘read_thumb_limit’ => 0 // See README for information about this setting.

    // Start the class
    $gallery = new imgbrowz0r($config);

    // XHTML stuff

    ImgBrowz0r 0.3-dev


    // Generate navigation and statistics
    $gallery_breadcrumbs = $gallery->breadcrumbs();
    $gallery_pagination = $gallery->pagination();
    $gallery_statistics = $gallery->statistics();

    // Display navigation
    echo ‘

    ‘, “nt”, $gallery_breadcrumbs, “nt”, $gallery_pagination, “nt”, $gallery_statistics, “n”, ‘

    ‘, “nn”;

    // Display images and directories
    echo $gallery->browse();

    // Display navigation
    echo ‘

    ‘, “nt”, $gallery_pagination, “nt”, $gallery_breadcrumbs, “n”, ‘

    ‘, “nn”;

    // Showing some stats
    echo ‘

    Processing time: ‘, round(get_microtime(microtime()) – get_microtime($start_timer), 5), ‘ && Memory usage: ‘, file_size(memory_get_usage()), ‘




    Sorry, I’m still not seeing the problem. I forgot to mention this is my first time messing with anything PHP.

    I looked back on the video (#64 Building a Photo Gallery) and noticed that he had a ?q=%PATH% on the back end of his link to the main_url. I remember having that in there before but I deleted it because I thought it was junk added on from Dreamweaver, but I put it back on (that’s) on line 38, so now it reads like this.

    38| ‘main_url’ => ‘’,

    line 65 still reads like this

    65|$gallery = new imgbrowz0r($config);

    Do you see anything wrong between these two codes?


    The problem is on line 37 (or before) of imgbrowz0r.php

    Ok. So what do I do with this information. "imgbrowz0r.php" only shows up on line 28. Is it written wrong, directing wrong, wrong file name?

    p.s. Thanks for the help so far.


    Yes, I know what it is and where it’s at. I just don’t understand what it’s saying about the file. It’s in the right directory. It wasn’t mirrored on my hard drive, but I fixed that with no change.

    I just fond this message in my live log on the server.

    [24-Aug-2009 06:59:52] PHP Fatal error: Cannot instantiate non-existent class: imgbrowz0r in /home/shepa0/public_html/chris/imgbrowz0r/index.php on line 65


    They use something called suPHP. Ever heard of it?


    Okay. I believe my problem was the server was using PHP 4.9 and not 5. So as far as this post Its resolved.


    Hello Friends,I have some problem regarding parsing.
    I am getting Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING error, here are the lines:
    for($i=0; $i<12; $i++){
    $aquery = "INSERT INTO uaq_scbatsmen VALUES(‘$row2’, ‘a’, ‘$a_player[$i]’, ‘$a_out[$i]’, ‘$a_balls[$i]’, ‘$a_4s[$i]’, ‘$a_6s[$i]’, ‘$a_runs[$i]’)";
    The problem line is the middle one ($aquery). Most probably problem is that I am missing some " or ; or something else but after hours of head banging I still can’t find the problem.
    Support executive

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Back End’ is closed to new topics and replies.