Forum Moderators: coopster

Message Too Old, No Replies

Fatal Error: undefined function mysql_connect()

Trying to connect to MySQL from PHP

         

kennyharrill

11:18 pm on May 16, 2005 (gmt 0)

10+ Year Member



I'm at my wits end on this one - I know ya'll have seen this problem before. Here are my specifics:

I'm running Windows 2000, Apache 2.0.52, Php5.0.2, and MySQL4.0.21.

All three work fine or seem to, but I cannot connect to MySQL from PHP.

I spent a good chunk of this weekend looking over posts like this on various discussion forums and here are the steps I've already tried, but to no avail:

** Enabled php_mysql.dll in my php.ini file
** Added php directory to my system path
** Changed extension_dir to "c:\php5\ext"
** added extension=mysql.so to php.ini file
** Copied my libmysql.dll file from php5 to winnt\system32 folder
** copied my php_mysql.dll file from php5/ext to the winnt/system32 folder

I also read that to compile, simply use --with-mysql=[DIR] where [DIR] points to the MySQL installation directory. Please clarify - what file does this involve?

Can anyone point out anything else that I may be doing wrong or need to correct? I'm needing to learn PHP/MySQL for my job and I need to get as much done ASAP! Any assistance is appreciated.

jatar_k

11:22 pm on May 16, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld kennyharrill,

maybe try some things in this thread, it also points to some other useful threads
[webmasterworld.com...]

>> I also read that to compile, simply use --with-mysql=[DIR]

won't help you on windows

StupidScript

11:26 pm on May 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you sure MySQL is running? It sounds like either the
mysqld
daemon has not been started or your system is being confused by your use of both the Apache shared object (.SO) file and the Windows dynamic link library (.DLL) file.

There are lots of how-tos for setting up a basic Windows/Apache/PHP/MySQL installation. Here's one [in.geocities.com] that may be useful to you. Do a Google search for

windows apache php mysql install
to see a million more.

jatar_k is correct (as usual): When you see something about "compiling" you are usually looking at an instruction for *Nix systems where it is common to build the program binaries to fit the system they are running on.

StupidScript

11:34 pm on May 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh! Welcome aboard, kennyharrill!

jatar_k

11:34 pm on May 16, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could also check the PHP LIbrary [webmasterworld.com] that we keep here, there are a few threads in there but they may all deal with XP.

You could also try an all-in-one package as well such as
[apachefriends.org...]

they have one listed for win2000 there

kennyharrill

2:21 am on May 17, 2005 (gmt 0)

10+ Year Member



Thanks for the help! I may well just try the all in one package. Appreciate it. I'll keep you posted on my progress.