Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

PHP 5.28 ---- no connection ----> MySQL 5.3 on IIS5.1

  • 17-09-2009 3:59pm
    #1
    Registered Users, Registered Users 2 Posts: 139 ✭✭


    For sh!ts & giggles, I have been playing around with an old PC at home which is running XP Pro.

    I have successfully (in so far as they are all working individually) installed the IIS windows component, PHP 5 and MySQL5 and even have my newly acquired domain name pointing at this setup
    I just can't get my php pages to connect to the database either on localhost, LAN or WAN. I know MySQL is running - MySQL Administrator is able to connect and I have created tables. I can also make an ODBC connection to the database from MS Access, but the php pages are returning a 500 Internal Server Error. This is the connection code:

    [PHP]
    <?php
    $hostname="localhost";
    $mysql_login="my_username";
    $mysql_password="my_password";
    $database="my_database";

    if (!($db = mysql_connect($hostname, $mysql_login , $mysql_password))){
    die("Can't connect to database server.");
    }else{
    // select a database
    if (!(mysql_select_db("$database",$db))){
    die("Can't connect to database.");
    }
    }
    ?>
    [/PHP]

    This is similar to a connection I am using on a hosted website which works fine. It doesn't work at home... :(
    I have also tried to get Dreamweaver to make a connection:eek:, but the same 500 Error is returned.

    Anyone had any similar experiences setting up IIS, PHP & MySQL successfully and can point a noob in the right direction


Comments

  • Registered Users, Registered Users 2 Posts: 139 ✭✭Bald? er, dash!


    Right, solved it myself...

    The php installation was manual, so you have to edit the php.ini file in c:\windows to remove the semicolon from in front of the required dll
    ;extension=php_mssql.dll
    extension=php_mysql.dll
    ;extension=php_mysqli.dll
    

    and then moving that .dll from the ext folder in the php installation folder to the installation root folder (e.g. from c:\php\ext\ to c:\php\) Reboot and away you go - at least that's what worked for me.

    Mods can lock if appropriate!


Advertisement