Problem connecting PHP - MySQL

I have an old server running PHP 4.4.5, MySQL 5.0.19-nt and PhpMyAdmin 2.8.0.2
running under IIS5 and XP Pro SP2

ALL is well - but the machine is ancient and slow.

I have a new server, much faster, again IIS 5 and XP Pro SP2
I have installed PHP 5.2.4, MySQL 5.0.45 and phpMyAdmin 2.11.1.

Myadmin logs in and talks to the databases

I have copied a simple ‘list database’ PHP file from the old server to the new server
It doesnt work, and after 4 hours I have pulled out what little hair I had left.
The error is

Fatal error: Call to undefined function mysql_connect() in D:websitestsrguidedtourshowdatabase.php on line 85

mysqli extension was already enabled, I enabled mysql extension as well - no change
I also copied the libmysql.dll file to the c:windowssystem32 folder - no change after reboot.

I had problems with the path to the php.ini file
I set Path to “…;d:php;…” in - so why php.ini is read from c:windowssystem32 I have no idea - I also set the system variable PHPRC system variable to d:php - no change

Any help would be appreciated - before I am completely bald

Allan
(cross posting with http://www.htmlforums.com/php-programming/t-no-error-messages-from-mysql-in-php-96408.html )

some ISS only suport the mysqli_ and not the mysql_ functions.

http://phphelp.com/forums/viewtopic.php?t=7475

This maybe a stupid question, but are you restarting the Web Server after you have enabled different modules and make changes to the php.ini file or file paths?

I have tried mysql.dll only and mysqli.dll only and both
same response

Rebooted every time

I tried
http://phphelp.com/forums/viewtopic.php?t=7475
and that gets around the problem, but surely that is just a workaround not the whole answer.

I have the same version of IIS working with PHP 4.4.5 and MySQL 5.0.19-nt with no problems at all (except the server is nearly dead).

i know it’s a workaround, the solution would be to change the script to use mysqli.

It does work with MySQLi - on the older system, but not the new one

On the new system MySQLI is set up and enabled - but doesnt work
hence the request for help

phpinfo indicate MySQLi is reported - but not MySQL
and also reports

Quote:

Configuration File (php.ini) Path C:WINDOWS Loaded Configuration File C:WINDOWSsystem32php.ini
This is an old .ini so fixed it - thats better

why is PHP using that path?
not picking up the php.ini from c:php?
I have set a system variable “PHPRC = c:php” and c:php is in the path variable!!

I had set the PHPRC path against the user instead of in teh System area

Problem solved

case closed

Thanks all

I have tried mysql.dll only and mysqli.dll only and both same response

Sponsor our Newsletter | Privacy Policy | Terms of Service