I've recently installed IIS on my XP Pro computer.
I've also installed PHP 5 on it.

I tested the php and it works fine.

BUT...
When I ran a PHP script that needed to connect to a MySQL database it gave me the following message:

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\pages.php on line 5

I read on the internet that that means that I need to "compile PHP with MySQL support". Can anyone show me how to do that step by step?

    There are many threads talking about this problem. You can do a search in this forum for it.

    I had faced the same problem. But managed to solve it.

    Check this thread.

      How DID you solve it?
      That's what I'm asking...

      I've searched all over the place and couldn't find a tutorial which shows me step by step how to add MySQL support for PHP running on IIS.

        Hi,

        the PHP manual itself contains a description on how to enable MySQL support. Here are the steps (assuming that you downloaded the zip package):

        1. Make sure that you have a valid php.ini in your windows directory
        2. copy libmysql.dll to the system32 directory
        3. set the extension_dir in php.ini to the ext directory of your PHP installation directory (like e.g. extension_dir=C:\php5\ext)
        4. enable the MySQL extension in php.ini by uncommenting the line extension=php_mysql.dll
        5. restart the IIS service

        Thomas

        P.S.: This also applies to apache/PWS...the steps are always the same on Windows.

          Thanks alot tsinka!!!
          You've helped me so much.
          And it wasn't that complicated...
          I now have PHP with mySQL support running on my IIS webserver.

          Thanks again,
          Cosmo

            Write a Reply...