For Programmers: Free Programming Magazines  


Home > Archive > PHP Installation > July 2005 > Problem with PHP5.0.4 and MySQL 4.1.12.a









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem with PHP5.0.4 and MySQL 4.1.12.a
Manfred.Fecke@hella.com

2005-07-24, 8:33 pm

Hi Folks

I got a Problem to get MySql started under PHP.
My configuration is:

OS: XP advanced server
Webserver: IIS
PHP Version: 5.0.4
MySQL Version: 4.1.12a
PHP runs as server module

Under myadminsql I got the following error message:
[1.20] I receive the error "cannot load MySQL extension, please check PHP
Configuration".
To connect to a MySQL server, PHP needs a set of MySQL functions called
"MySQL extension". This extension may be part of the PHP distribution
(compiled-in), otherwise it needs to be loaded dynamically. Its name is
probably mysql.so or php_mysql.dll. phpMyAdmin tried to load the extension
but failed.

Usually, the problem is solved by installing a software package called
"PHP-MySQL" or something similar.


If I use the following php script to test the connection to mysql.
The script hung at: $db = @MYSQL_CONNECT($db_server,$db_user,$db_p
asswort)
or die ("Cannot connect to database");


<?PHP
error_reporting(1+2+4+8);
/* Datenbankserver - In der Regel die IP */
$db_server = "localhost";

/* Datenbankname */
$db_name = "mysql";

/* Datenbankuser */
$db_user = "root";

/* Datenbankpasswort */
$db_passwort = "service";

/* Erstellt Connect zu Datenbank her */
$db = @MYSQL_CONNECT($db_server,$db_user,$db_p
asswort) or die ("Cannot
connect to database");

if($db)
echo "Verbindung zur Datenbank wurde hergestellt";
echo "<br>";

/* mysql_query("TRUNCATE TABLE 'bb2_shoutbox'");

/* Schliessen der Datenbank-Verbindung */
$db_close = @MYSQL_CLOSE($db);

if($db_close)
echo "Verbindung zur Datenbank geschlossen";
else
echo "Konnte Verbindung zur Datenbank nicht schliessen";
?>


Best regards and thanks


Manfred Fecke


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com