Everyone read closely... this is a nice error report that shows a) he's done his homework and b) what he tried that didn't work.


Chris Hunt wrote:

All,

I'm a newbie trying to learn PHP and MySQL (following examples in a book "PHP and MySQL by 
Larry Ullman".  I am running:

Windows XP SP1
Norton Antivirus and Internet Security
Apache 2
PHP 5

I assume you mean 5.0.0, and not one of the release candidates or betas?

MySQL 4.0.16

All seem to work. I can run PHP scripts on the Apache server without any trouble. I have MySQL running as a service and the basic SQL command line commands and winmysqladmin shows all ok (to my limited knowledge so far).

So as the PHP installation instructions stated :

  Since PHP 4.0.5 MySQL, ODBC, FTP, Calendar, BCMath, COM, PCRE,
  Session, WDDX and XML support is built-in. You don't need to
  load any additional extensions in order to use these functions.

and I have basic PHP scripts running I though making a call to mysql_connect would be 
pretty straight forward.  The script I'm running is simply

<?php

echo mysql_connect ('localhost', 'webuser', 'BroWs1ng');

?>

where [EMAIL PROTECTED] has been granted select privileges on a test database.  I 
receive the following error message:


Fatal error: Call to undefined function mysql_connect() in C:\WebSpace\mysql_test.php on line 3


I was surprised to see mysql_connect was underfined given that the installation notes stated support for MySQL was built in from 4.0.5 onwards.

So I went to the php.ini file in my windows directory and tried to manually load the 
mysql dll by uncommenting (removing the semi colon) the following line:
  ;extension=php_mysql.dll
When I restart Apache I get the following error:
  PHP Startup: Unable to load dynamic library 'c:\PHP\ext\php_mysql.dll' - The 
specified module could not be found

Some people have had this problem when Apache can't find libmysql. Someone on the Windows list a few days ago said that putting libmysql into their c:\php\ext\ directory did the trick - but putting it into your systems (C:\windows\system32) directory should also work.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to