#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2009
    Location
    United States
    Posts
    119
    Rep Power
    140

    Setting up typical WAMP server


    I just set up an Apache/MySQL/PHP server on Windows 7, but I'm having a hard time getting MySQL to work with PHP. Whenever I try to connect to MySQL in my PHP code, it simply won't load the page. I think I narrowed it down to port 3306 being the problem, but how do I open port 3306 on localhost? It's open on 0.0.0.0 ...is that the same as 127.0.0.1?
  2. #2
  3. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,933
    Rep Power
    9647
    Likely a PHP question, not Windows.

    - There's no traffic going in or out of your computer so ports have nothing to do with it.
    - 0.0.0.0 means that MySQL is listening on every IP address it can. That's fine. Not a problem. Leave it like that.

    "won't load the page"... Go into your php.ini file and change the two values listed below to:
    Code:
    error_reporting = E_ALL
    display_errors = on
    Restart Apache/WAMP and try the page again. Probably won't work, but this time you should get an error message or two.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2009
    Location
    United States
    Posts
    119
    Rep Power
    140
    I get this error...
    Code:
    Warning: mysqli_connect() [function.mysqli-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in D:\server\www\development.server\public_html\mysqli.php on line 2
    
    Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in D:\server\www\development.server\public_html\mysqli.php on line 2
    PHP pages work just fine unless I have some sort of mysql or mysqli connector in there. That's when the page just sits and loads until it times out.


    And yeah, I wasn't sure which category to put it in since it's several different things acting together to give me the server.
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,565
    Rep Power
    4550
    Check your firewall and make sure port 3306 is open through the firewall. If you used something like netstat to show listening ports, I'm thinking netstat is running inside the firewall and would show a listening port even if it was blocked in the firewall.

    I use xampp myself, it took maybe 2 minutes to get setup and running on windows 7.

    Comments on this post

    • DonR agrees : install xampp and change permissions to the xampp folder [and subfolders] to allow your user acct full access to it and you should be good to go.
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2009
    Location
    United States
    Posts
    119
    Rep Power
    140
    I've completely halted any firewalls on my computer and I still couldn't get this to work, so I suppose I'll just go with XAMPP...Thanks for the help.

IMN logo majestic logo threadwatch logo seochat tools logo