Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts

    Installing php5 and mysql 4.1 on IIS

    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:
    Code:
    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.

  • #2
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Questions are what binds the universe,
    Questions lead to answers,
    Answers lead to knowledge,
    Knowledge leads to wisdom,
    Wisdom brings more questions -- Horus Kol, 2004 :)

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    ... 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
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #4
    Regular Coder
    Join Date
    Oct 2004
    Posts
    256
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Questions are what binds the universe,
    Questions lead to answers,
    Answers lead to knowledge,
    Knowledge leads to wisdom,
    Wisdom brings more questions -- Horus Kol, 2004 :)

  • #6
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    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

  • #7
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...
    Questions are what binds the universe,
    Questions lead to answers,
    Answers lead to knowledge,
    Knowledge leads to wisdom,
    Wisdom brings more questions -- Horus Kol, 2004 :)

  • #8
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    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

  • #9
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Questions are what binds the universe,
    Questions lead to answers,
    Answers lead to knowledge,
    Knowledge leads to wisdom,
    Wisdom brings more questions -- Horus Kol, 2004 :)

  • #10
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Horus Kol
    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

  • #11
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Shinitenshi,

    What bit do you want help with?
    Questions are what binds the universe,
    Questions lead to answers,
    Answers lead to knowledge,
    Knowledge leads to wisdom,
    Wisdom brings more questions -- Horus Kol, 2004 :)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •