PHP and MySQL problem

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
aliweb
Forum Newbie
Posts: 5
Joined: Tue Aug 22, 2006 1:40 am

PHP and MySQL problem

Post by aliweb »

Hello

I am using MySQL 4.1 and PHP 5.1.1.
When I try to connect to MySQL in PHP using mysql_connect() method, it throws an error "Call to undefined function mysql_connect().

Then I uncommented the following line in C:\Windows\php.ini file

extension=php_mysql.dll

and placed php_mysql.dll in C:\Windows\System32

Now when I tried to run that PHP page again, it goes no where. I mean it neither throws an error nor loads the page. It just keeps on loading and the status bar below in Internet Explorer says "Waiting http://localhost/connection.php

Now after that even if I run a simple PHP page for e.g.

echo "Hello";

it doesn't work and keeps on loading.

If I comment that line again above, normal PHP page works but not connection ones.

I even placed libmysql.dll in C:\Windows\System32 but same problem.

My configuration is:

OS: Windows Server 2003
Web Server: IIS 6
PHP: 5.1.1
MySQL: 4.1
PHP Dir: C:\PHP

Please help
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Post by kaszu »

MySQL library is not loaded
In php.ini, change from
display_startup_errors = Off
to
display_startup_errors = On
Then you will see the error.

I put "libmysql.dll" in Apache bin folder (i'm running php as apache module) and everything worked fine.
Make sure extension dir in php.ini is correct.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Restart your server. Then try again.
Post Reply