...

View Full Version : Installing php5 and mysql 4.1 on IIS



Brandoe85
12-20-2004, 03:25 AM
I have recently gotten a new computer, and have IIS running, on my old computer I had apache. When I was running apache, everything worked fine. Now when I run a php page(without any mysql connections), everything works fine, but when I try to use mysql, I get this error:


Fatal error: Call to undefined function mysql_connect()

Now I've googled this countless times, and tried many different things and nothing has worked. I changed my php.ini file and uncommented the extension=php_mysql.dll line, and changed the extension_dir = line to point to the php_mysql.dll location. Which I moved into the php folder, I read somewhere online that you need to do all this since php5 doesn't come standard with mysql or something. Also, I don't actually have a php.ini file, I have one that says php.ini-dist, and php.ini-recommended. I didn't know so I changed both. My question is, has anyone had this problem, or have php5 and mysql running on IIS. Mysql works fine, I can connect up through the command line, but when I try to use it in php, I get a fatal error. Any suggestions?
Also, I've ran <?php phpinfo();?> and did a search for mysql, and the only things that come up are in some paths, in the path has mysql in there. It says nothing else about it.

Horus Kol
12-20-2004, 12:51 PM
You need to copy one or other of those php.ini- files... the php.ini-distribution is a barebone set of options, waiting to be fully configured. the php.ini-recommended has a few options preset for more secure operations...

so, you need to copy one of them and rename the copy to just "php.ini" - then any changes you make will take affect.

firepages
12-20-2004, 02:17 PM
... and put the php.ini in a system directory like c:/windows etc , you also may need to copy the libmysql.dll to c:/windows or c:/windows/system32

Sayonara
12-20-2004, 02:32 PM
Unless you absolutely have to use IIS for any reason, try this out:

http://www.wampserver.com/en/index.php

It should make things a little less clanky than they are under IIS.

Horus Kol
12-20-2004, 02:43 PM
Originally Posted by firepages
... and put the php.ini in a system directory like c:/windows etc , you also may need to copy the libmysql.dll to c:/windows or c:/windows/system32

That is no longer necessary - the php.ini can reside in the same folder as the executable - in fact, it has to on my laptop as I have PHP4 and PHP5 for testing purposes

Brandoe85
12-21-2004, 05:35 AM
Thanks for the help guys :) Though, After I fixed that problem I got numerous more. I decided not to use IIS, it's just giving me a headache trying to get php and mysql going on it. I guess when I need to do some asp I'll have to take an alternative route :p

Horus Kol
12-21-2004, 08:34 AM
setting up PHP on IIS isn't really all that difficult - I have done it loads of times on Windows 2000, XP and 2003...

If you want any help with it, give a shout...

Brandoe85
12-21-2004, 08:48 AM
I had php going just fine, just when I tried to add mysql into the mix is where I started getting all the problems. I'd get cannot load dynamic library error, then I couldn't connect to mysql becuase of some other errors. I looked online for weeks, and tried everything, in many different ways, but nothing worked. It's wierd how on apache everything worked no problem I didn't even have to do anything really(or it seemed). But when I moved to IIS everything went wrong. Very Frusterating :mad:

Horus Kol
12-21-2004, 10:32 AM
I have only had one real problem with PHP and IIS, and that was the first time I put it on Win2003 and IIS 6.0

All you need to know about installing is available at www.php.net , although I will admit that the instructions are spread about a bit.

I think the reason Apache is easier is because you can use PHP as a CGI module... but I have never used this, so I won't pretend to know what I'm doing there...

For the other method, you need to go through the php.ini file and set a few things - but only about 5 changes need to be made for it to work.

Shinitenshi
01-03-2005, 04:41 PM
setting up PHP on IIS isn't really all that difficult - I have done it loads of times on Windows 2000, XP and 2003...

If you want any help with it, give a shout...

I just Got windows Server2003 Web Edition and i need help seeting it up any one that could give a hand thx.

aim = Link Rox 04 92
msn = zeldaseries@hotmail.com

emails:
zeldaseries@gmail.com
zeldaseries@hotmail.com

Horus Kol
01-04-2005, 09:57 AM
Shinitenshi,

What bit do you want help with?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum