|
Prev: Compiling PHP on Windows as static lib produces a dynamic lib
Next: php on w2k3 server with IIS6
From: anonymous on 16 Jul 2008 11:50 I had a tough time getting PHP to connect to MySQL using mysqli on XP. The following code from the php documentation on mysqli failed to work. $mysqli = new mysqli( "localhost", "user", "password", "database" ); Where localhost, user, password, and database were replaced with the appropriate values. I left the host parameter as "localhost" because that's what I wanted, however that did not work. So I changed it to NULL, which defaults to localhost as per the documentation, but this still did not work. After some googling, I found the answer on another forum, which stated that the host should be a dot ".", but no other explanation was given. Is there anyone that can shed some light on the situation? Everything works fine now, but I would really like to know why I can't use "localhost", and why this isn't documented. I've tried every mysqli option imaginable in the php.ini file. It seems that host must be a dot.
From: "Jacob Kruger" on 16 Jul 2008 14:00 Only thing I can think of off-hand is that maybe they want an IP address since 127.0.0.1 maps to localhost that might be worth a try. STay well Jacob Kruger Blind Biker Skype: BlindZA '...Fate had broken his body, but not his spirit...' ----- Original Message ----- From: "anonymous" <blockstack(a)gmail.com> To: <php-windows(a)lists.php.net> Sent: Wednesday, July 16, 2008 5:50 PM Subject: [PHP-WIN] Trouble connecting to MySQL using mysqli extension on XP >I had a tough time getting PHP to connect to MySQL using mysqli on XP. > The following code from the php documentation on mysqli failed to work. > > $mysqli = new mysqli( "localhost", "user", "password", "database" ); > > Where localhost, user, password, and database were replaced with the > appropriate values. > I left the host parameter as "localhost" because that's what I wanted, > however that did not work. > So I changed it to NULL, which defaults to localhost as per the > documentation, but this still did not work. > > After some googling, I found the answer on another forum, which stated > that the host should be a dot ".", but no other explanation was given. > > Is there anyone that can shed some light on the situation? > Everything works fine now, but I would really like to know why I can't use > "localhost", and why this isn't documented. > > I've tried every mysqli option imaginable in the php.ini file. > It seems that host must be a dot. > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
From: "Jacob Kruger" on 16 Jul 2008 18:31 Well, then have no real idea, but will just say again that when trying to implement PHP and MySQL support on my instance of IIS, I couldn't get MySQL's drivers to work, no matter what I tried implementing with regard to the %path% system variable, the path/instance of the relevant .dll file etc. etc., so eventually went over to the WAMP package, which includes all of them, and just made it run on port 81, so that it and IIS wouldn't interfere with each other, and it works fine. Not sure if you've tried this before? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...Fate had broken his body, but not his spirit...' ----- Original Message ----- From: "anonymous" <blockstack(a)gmail.com> To: "Jacob Kruger" <jacobk(a)cknet.co.za> Sent: Wednesday, July 16, 2008 9:14 PM Subject: Re: [PHP-WIN] Trouble connecting to MySQL using mysqli extension on XP >I forgot to mention I tried that too, with no luck. > > On Wed, Jul 16, 2008 at 1:00 PM, Jacob Kruger <jacobk(a)cknet.co.za> wrote: > >> Only thing I can think of off-hand is that maybe they want an IP address >> since 127.0.0.1 maps to localhost that might be worth a try. >> >> STay well >> >> Jacob Kruger >> Blind Biker >> Skype: BlindZA >> '...Fate had broken his body, but not his spirit...' >> >> ----- Original Message ----- From: "anonymous" <blockstack(a)gmail.com> >> To: <php-windows(a)lists.php.net> >> Sent: Wednesday, July 16, 2008 5:50 PM >> Subject: [PHP-WIN] Trouble connecting to MySQL using mysqli extension on >> XP >> >> >> I had a tough time getting PHP to connect to MySQL using mysqli on XP. >>> The following code from the php documentation on mysqli failed to work. >>> >>> $mysqli = new mysqli( "localhost", "user", "password", "database" ); >>> >>> Where localhost, user, password, and database were replaced with the >>> appropriate values. >>> I left the host parameter as "localhost" because that's what I wanted, >>> however that did not work. >>> So I changed it to NULL, which defaults to localhost as per the >>> documentation, but this still did not work. >>> >>> After some googling, I found the answer on another forum, which stated >>> that the host should be a dot ".", but no other explanation was given. >>> >>> Is there anyone that can shed some light on the situation? >>> Everything works fine now, but I would really like to know why I can't >>> use >>> "localhost", and why this isn't documented. >>> >>> I've tried every mysqli option imaginable in the php.ini file. >>> It seems that host must be a dot. >>> >>> -- >>> PHP Windows Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> >
|
Pages: 1 Prev: Compiling PHP on Windows as static lib produces a dynamic lib Next: php on w2k3 server with IIS6 |