Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Call to undefined function: glob()


Guest

Recommended Posts

Posted

Can anyone tell me what this error means:

 

 

Fatal error: Call to undefined function: glob() in /usr/local/htdocs/freetibet/catalog/includes/classes/cc_show.php on line 83

 

Ta

 

Callum

Posted

glob() is a function that was introduced in PHP 4.3.0 that allows easy searching/matching within filesystem directories.

 

For example:

<?php
foreach (glob("*.txt") as $filename) {
  echo "$filename size " . filesize($filename) . "\n";
}
?>

Will output all the files in the directory.

 

If you're server does not have at least PHP 4.3.0 you will not have this function available and will give the error above. I would recommend upgrading the PHP version...

 

Alternately, you can use old-school code to the same effect like this:

	$dir = $cache_dir;
if (is_dir($dir)) {
   if ($dh = opendir($dir)) {
    while (($file = readdir($dh)) !== false) {
   *dosomethingwith($file);
    }
    closedir($dh);
   }
}

You can reference the PHP documentation on the glob function here: PHP Documentation on glob

 

Bobby

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...