Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fatal error: Call to undefined function: glob()

Status
Not open for further replies.

JASONE25

Technical User
Jun 23, 2005
54
NL
Hi experts i got an php script that when i run i get this error:

Code:
Fatal error: Call to undefined function: glob() in c:\inetpub\[URL unfurl="true"]wwwroot\test\avatars.php[/URL] on line 27

Code:
 $aFiles = glob("$sDir/$sPattern", $nFlags);

foreach (glob("$sDir/*", GLOB_ONLYDIR) as $sSubDir)
  {
   $aSubFiles = rglob($sSubDir, $sPattern, $nFlags);
   $aFiles = array_merge($aFiles, $aSubFiles);
  }

  // The array we return contains the files we found, and the
  // files all of our children found.

  return $aFiles;
}

/* Get Listing of avatars */
$files = rglob (AVATARS_DIR.AVATARS_DIR_STOCK, '*');
sort ($files, SORT_STRING);

could an expert tell me how i can fix it. I am running php 4.2.0.
 
Many thanksf or u reply. I install PHP Version 5.0.4 . But now when i load the page i get this error:

Code:
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\[URL unfurl="true"]wwwroot\test\database.php[/URL] on line 23

my phpMyAdmin also stoped working!! it gives me this error :

Code:
cannot load mysql extension;
please check PHP configuration
Documentation

I be happy if u help me fix this error.Thanks
 
To expand VBakians' answer:

glob() is available since PHP 4.3.0, so your version does not yet contain this function. That is why you're getting an error.
 
Well i installed the latest version php and re install my sql and phpmyadmin but now i get this error when i run my phpAdmin


Code:
cannot load mysql extension;
please check PHP configuration

could any one help me fix this error.Thanks
 
Goto the installation folder of php. Propably C:/php/

Open the install.txt
Edit -> Find "php_mysql.dll"

It's explained what to do.
 
Many thanks vbkias for u reply. I collected php_zip.dll and php_ssh2.dll files from this zip file pecl-5.0.4-Win32.
Code:
PHP extension DLL files, such as php_mysql.dll and php_curl.dll,
       are found in the zip package of the PHP download (not the PHP
       installer). In PHP 5, many extensions are part of PECL and can be
       downloaded in the "Collection of PECL modules" package. Files such
       as php_zip.dll and php_ssh2.dll. Download PHP files here.

Could u tell me where should place them.Thanks
 
store them in the ext folder.
add the files name to the php.ini
just like how you have this: php_mysql.dll
 
Thanks again mate. There is no ext folder under c:\php\ !!
i only see BACKUP,SESSIONDAA AND UPLOADTEMP folder. Furtheremore, in which part of the php.ini should i place the files names.Thank
 
php_zip.dll is already in the php.ini
Just enable this:
extension=php_zip.dll

And add:
extension=php_ssh2.dll

In this case, just store them in the PHP folder.
It should be fine.
 
I put the 2 files inside c:\php and put the following lines

Code:
;extension=php_ssh2.dll
;extension=php_zip.dll

aftr this line :

Code:
;extension=php_zlib.dll

I turn of iis and re start it and same strange error ? Any solution ?Thanks
 
ah. Same error again without ';'!! Am i doing any thing wrong here.Thanks
 
In newer versions of php such as your installed, there is no need of these dlls. So by default in the php.ini file, they are commented. This ini file is copied in //windows during installation. You don;t copy it by yourself.

From the middle of the file php.ini and so on there are some other settings about ODBC and mySQL. Are they correct?

Also add the folder C:/php/ to the system environment variables $PATH. Right click on My computer -> Properties -> select tab page "Advanced" -> hit Environment variables. At the second listbox, dbclick "path" and add the php installation directory.

Notice that the paths are seperated by ";
 
huh?

i thought u had to create a folder called "extensions" in the PHP folder and place the extensions in them!!!

Known is handfull, Unknown is worldfull
 
when i type i get this error for my phpMyAdmin!!

Code:
cannot load mysql extension;
please check PHP configuration
Documentation

I did not change any odbc or mysql setting from php.ini file. I also add the php path but still the same!!
 
PHP5 uses probably mysqli and not mysql.
Have you checked out from your phpinfo() what is compiled in the standeard distribution?
 
PHP 5 can use either the mysql or mysqli family of functions. It all depends on which version of MySQL you are using and thus which client libraries are available.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top