RES: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Alejandro Michelin Salomon
Sueandant :

Goto your my.ini file
In my case located in C:\Arquivos de programas\MySQL\MySQL Server 5.1

Search is this configuration option is enabled = skip-networking
And comment to enabled listen on a TCP/IP port. Default port 3306

Or 
Put = enable-named-pipe to enable named pipes

Alejandro M.S.
-Mensagem original-
De: sueandant [mailto:hollandsath...@tiscali.co.uk] 
Enviada em: segunda-feira, 4 de outubro de 2010 18:08
Para: php-general@lists.php.net
Assunto: [PHP] Connecting to MySql with PHP

I am running PHP 5.3.3, with Apache 2.0 Handler and MySql Server 5.1.   My
OS is Vista Home Premium 32 bit with SP2.

MySql works fine from the command prompt, Apache is running and PHP works.
But I cannot access the mysqli classes.   This simple program:

?php

$mysqli = new mysqli(localhost, root, ##, testDB);#I've
deliberately obliterated the password

if (mysqli_connect_errno()) {
 printf(Connect failed: %s\n, mysqli_connect_error());
 exit();
} else {
 printf(Host information: %s\n, mysqli_get_host_info($mysqli));
}
?

produces this error message:

Warning: mysqli::mysqli() [mysqli.mysqli]: [2002] A connection attempt
failed because the connected party did not (trying to connect via
tcp://localhost:3306) in C:\Apache\htdocs\mysqlconnect.php on line 3

Warning: mysqli::mysqli() [mysqli.mysqli]: (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 C:\Apache\htdocs\mysqlconnect.php on line 3

Fatal error: Maximum execution time of 30 seconds exceeded in
C:\Apache\htdocs\mysqlconnect.php on line 3

I guess PHP cannot find the mysqli classes.   I've checked the phpinfo()
output and discovered :

  Configuration File (php.ini) Path  C:\Windows  
  Loaded Configuration File  C:\PHP\php.ini  


I don't know if this ok.   I've tried changing the location of the loaded
file to C:\Windows\php.ini, but to no avail, and I don't know how to change
the location of the config file.

I am obviously doing something wrong, but I don't know what.   Can anyone
help?

Ironically, everything worked perfectly before I upgraded to PHP 5.3.3!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RES: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Alejandro Michelin Salomon
Sueandant :

Reading more carefully your email, and search for this error in the net.
Y find this page
http://coreygilmore.com/blog/2009/11/20/fix-php-5-3-hang-on-windows/

Try this

Alejandro M.S.

-Mensagem original-
De: Alejandro Michelin Salomon [mailto:amichel...@hotmail.com] 
Enviada em: terça-feira, 5 de outubro de 2010 09:01
Para: 'sueandant'
Cc: php-general@lists.php.net
Assunto: RES: [PHP] Connecting to MySql with PHP

Sueandant :

Goto your my.ini file
In my case located in C:\Arquivos de programas\MySQL\MySQL Server 5.1

Search is this configuration option is enabled = skip-networking
And comment to enabled listen on a TCP/IP port. Default port 3306

Or 
Put = enable-named-pipe to enable named pipes

Alejandro M.S.
-Mensagem original-
De: sueandant [mailto:hollandsath...@tiscali.co.uk] 
Enviada em: segunda-feira, 4 de outubro de 2010 18:08
Para: php-general@lists.php.net
Assunto: [PHP] Connecting to MySql with PHP

I am running PHP 5.3.3, with Apache 2.0 Handler and MySql Server 5.1.   My
OS is Vista Home Premium 32 bit with SP2.

MySql works fine from the command prompt, Apache is running and PHP works.
But I cannot access the mysqli classes.   This simple program:

?php

$mysqli = new mysqli(localhost, root, ##, testDB);#I've
deliberately obliterated the password

if (mysqli_connect_errno()) {
 printf(Connect failed: %s\n, mysqli_connect_error());
 exit();
} else {
 printf(Host information: %s\n, mysqli_get_host_info($mysqli));
}
?

produces this error message:

Warning: mysqli::mysqli() [mysqli.mysqli]: [2002] A connection attempt
failed because the connected party did not (trying to connect via
tcp://localhost:3306) in C:\Apache\htdocs\mysqlconnect.php on line 3

Warning: mysqli::mysqli() [mysqli.mysqli]: (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 C:\Apache\htdocs\mysqlconnect.php on line 3

Fatal error: Maximum execution time of 30 seconds exceeded in
C:\Apache\htdocs\mysqlconnect.php on line 3

I guess PHP cannot find the mysqli classes.   I've checked the phpinfo()
output and discovered :

  Configuration File (php.ini) Path  C:\Windows  
  Loaded Configuration File  C:\PHP\php.ini  


I don't know if this ok.   I've tried changing the location of the loaded
file to C:\Windows\php.ini, but to no avail, and I don't know how to change
the location of the config file.

I am obviously doing something wrong, but I don't know what.   Can anyone
help?

Ironically, everything worked perfectly before I upgraded to PHP 5.3.3!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread sueandant

- Original Message - 
From: sueandant 
To: a...@ashleysheridan.co.uk 
Sent: Monday, October 04, 2010 10:29 PM
Subject: Re: [PHP] Connecting to MySql with PHP


Thanks Ash

Where do I find the PHP mysql module?   I have uncommented both the extensions 
php-mysql.dll and php-mysqli.dll; do I need to do more?

Thanks

Tony Holland
  - Original Message - 
  From: a...@ashleysheridan.co.uk 
  To: sueandant ; php-general@lists.php.net 
  Sent: Monday, October 04, 2010 10:21 PM
  Subject: Re: [PHP] Connecting to MySql with PHP


  Have you installed the php mysql module? Basically, it tells php how to 
connect to mysql.

  This question has come up a few times this week, have you tried installing 
something like xampp or easyphp rather than the individual software components: 
Apache, php  mysql.

  Thanks,
  Ash
  http://www.ashleysheridan.co.uk

  - Reply message -
  From: sueandant hollandsath...@tiscali.co.uk
  Date: Mon, Oct 4, 2010 22:08
  Subject: [PHP] Connecting to MySql with PHP
  To: php-general@lists.php.net

  I am running PHP 5.3.3, with Apache 2.0 Handler and MySql Server 5.1.   My OS 
is Vista Home Premium 32 bit with SP2.

  MySql works fine from the command prompt, Apache is running and PHP works.   
But I cannot access the mysqli classes.   This simple program:

  ?php

  $mysqli = new mysqli(localhost, root, ##, testDB);#I've 
deliberately obliterated the password

  if (mysqli_connect_errno()) {
  printf(Connect failed: %s\n, mysqli_connect_error());
  exit();
  } else {
  printf(Host information: %s\n, mysqli_get_host_info($mysqli));
  }
  ?

  produces this error message:

  Warning: mysqli::mysqli() [mysqli.mysqli]: [2002] A connection attempt failed 
because the connected party did not (trying to connect via 
tcp://localhost:3306) in C:\Apache\htdocs\mysqlconnect.php on line 3

  Warning: mysqli::mysqli() [mysqli.mysqli]: (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 C:\Apache\htdocs\mysqlconnect.php on line 3

  Fatal error: Maximum execution time of 30 seconds exceeded in 
C:\Apache\htdocs\mysqlconnect.php on line 3

  I guess PHP cannot find the mysqli classes.   I've checked the phpinfo() 
output and discovered :

   Configuration File (php.ini) Path  C:\Windows  
   Loaded Configuration File  C:\PHP\php.ini  


  I don't know if this ok.   I've tried changing the location of the loaded 
file to C:\Windows\php.ini, but to no avail, and I don't know how to change the 
location of the config file.

  I am obviously doing something wrong, but I don't know what.   Can anyone 
help?

  Ironically, everything worked perfectly before I upgraded to PHP 5.3.3!



Re: Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 13:35 +0100, sueandant wrote:
 - Original Message - 
 From: sueandant 
 To: a...@ashleysheridan.co.uk 
 Sent: Monday, October 04, 2010 10:29 PM
 Subject: Re: [PHP] Connecting to MySql with PHP
 
 
 Thanks Ash
 
 Where do I find the PHP mysql module?   I have uncommented both the 
 extensions php-mysql.dll and php-mysqli.dll; do I need to do more?
 

Just curious... BUT

Did you restart apache (or your webserver software) ?



 Thanks
 
 Tony Holland
   - Original Message - 
   From: a...@ashleysheridan.co.uk 
   To: sueandant ; php-general@lists.php.net 
   Sent: Monday, October 04, 2010 10:21 PM
   Subject: Re: [PHP] Connecting to MySql with PHP
 
 
   Have you installed the php mysql module? Basically, it tells php how to 
 connect to mysql.
 
   This question has come up a few times this week, have you tried installing 
 something like xampp or easyphp rather than the individual software 
 components: Apache, php  mysql.
 
   Thanks,
   Ash
   http://www.ashleysheridan.co.uk
 
   - Reply message -
   From: sueandant hollandsath...@tiscali.co.uk
   Date: Mon, Oct 4, 2010 22:08
   Subject: [PHP] Connecting to MySql with PHP
   To: php-general@lists.php.net
 
   I am running PHP 5.3.3, with Apache 2.0 Handler and MySql Server 5.1.   My 
 OS is Vista Home Premium 32 bit with SP2.
 
   MySql works fine from the command prompt, Apache is running and PHP works.  
  But I cannot access the mysqli classes.   This simple program:
 
   ?php
 
   $mysqli = new mysqli(localhost, root, ##, testDB);#I've 
 deliberately obliterated the password
 
   if (mysqli_connect_errno()) {
   printf(Connect failed: %s\n, mysqli_connect_error());
   exit();
   } else {
   printf(Host information: %s\n, mysqli_get_host_info($mysqli));
   }
   ?
 
   produces this error message:
 
   Warning: mysqli::mysqli() [mysqli.mysqli]: [2002] A connection attempt 
 failed because the connected party did not (trying to connect via 
 tcp://localhost:3306) in C:\Apache\htdocs\mysqlconnect.php on line 3
 
   Warning: mysqli::mysqli() [mysqli.mysqli]: (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 C:\Apache\htdocs\mysqlconnect.php on line 3
 
   Fatal error: Maximum execution time of 30 seconds exceeded in 
 C:\Apache\htdocs\mysqlconnect.php on line 3
 
   I guess PHP cannot find the mysqli classes.   I've checked the phpinfo() 
 output and discovered :
 
Configuration File (php.ini) Path  C:\Windows  
Loaded Configuration File  C:\PHP\php.ini  
 
 
   I don't know if this ok.   I've tried changing the location of the loaded 
 file to C:\Windows\php.ini, but to no avail, and I don't know how to change 
 the location of the config file.
 
   I am obviously doing something wrong, but I don't know what.   Can anyone 
 help?
 
   Ironically, everything worked perfectly before I upgraded to PHP 5.3.3!
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Jason
-Original Message-
From: Steve Staples [mailto:sstap...@mnsi.net] 
Sent: 05 October 2010 13:55
To: php-general
Subject: Re: Fw: [PHP] Connecting to MySql with PHP

On Tue, 2010-10-05 at 13:35 +0100, sueandant wrote:
 - Original Message - 
 From: sueandant 
 To: a...@ashleysheridan.co.uk 
 Sent: Monday, October 04, 2010 10:29 PM
 Subject: Re: [PHP] Connecting to MySql with PHP
 
 
 Thanks Ash
 
 Where do I find the PHP mysql module?   I have uncommented both the 
 extensions php-mysql.dll and php-mysqli.dll; do I need to do more?
 

Just curious... BUT

Did you restart apache (or your webserver software) ?



Also, did you configure the windows firewall to allow connections into the 
MySQL server?

J


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread Steve Staples
On Tue, 2010-10-05 at 14:02 +0100, Jason wrote:
 -Original Message-
 From: Steve Staples [mailto:sstap...@mnsi.net] 
 Sent: 05 October 2010 13:55
 To: php-general
 Subject: Re: Fw: [PHP] Connecting to MySql with PHP
 
 On Tue, 2010-10-05 at 13:35 +0100, sueandant wrote:
  - Original Message - 
  From: sueandant 
  To: a...@ashleysheridan.co.uk 
  Sent: Monday, October 04, 2010 10:29 PM
  Subject: Re: [PHP] Connecting to MySql with PHP
  
  
  Thanks Ash
  
  Where do I find the PHP mysql module?   I have uncommented both the 
  extensions php-mysql.dll and php-mysqli.dll; do I need to do more?
  
 
 Just curious... BUT
 
 Did you restart apache (or your webserver software) ?
 
 
 
 Also, did you configure the windows firewall to allow connections into the 
 MySQL server?
 
 J
 
 

Jason:
if you're using it via localhost, does the firewall come into play here?

All:
Also, the BIND-ADDRESS in the my.cnf, it may not be set properly
(usually they say to comment that line out)

Steve.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Fw: [PHP] Connecting to MySql with PHP

2010-10-05 Thread musicdev

Hello,

remember that for windows, you must also copy the library (libmysql.dll) to 
window's system32 directory in addition to un-commenting the 
extension=php_mysql.dll line in php.ini.  Also, just in case, ensure that 
php.ini also has the proper extension directory set, typically c:\php\ext 
but depends on where you installed php.


--
From: Steve Staples sstap...@mnsi.net
Sent: Tuesday, October 05, 2010 9:08 AM
To: 'php-general' php-general@lists.php.net
Subject: RE: Fw: [PHP] Connecting to MySql with PHP


On Tue, 2010-10-05 at 14:02 +0100, Jason wrote:

-Original Message-
From: Steve Staples [mailto:sstap...@mnsi.net]
Sent: 05 October 2010 13:55
To: php-general
Subject: Re: Fw: [PHP] Connecting to MySql with PHP

On Tue, 2010-10-05 at 13:35 +0100, sueandant wrote:
 - Original Message - 
 From: sueandant

 To: a...@ashleysheridan.co.uk
 Sent: Monday, October 04, 2010 10:29 PM
 Subject: Re: [PHP] Connecting to MySql with PHP


 Thanks Ash

 Where do I find the PHP mysql module?   I have uncommented both the 
 extensions php-mysql.dll and php-mysqli.dll; do I need to do more?



Just curious... BUT

Did you restart apache (or your webserver software) ?



Also, did you configure the windows firewall to allow connections into 
the MySQL server?


J




Jason:
if you're using it via localhost, does the firewall come into play here?

All:
Also, the BIND-ADDRESS in the my.cnf, it may not be set properly
(usually they say to comment that line out)

Steve.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Connecting to MySql with PHP

2010-10-04 Thread sueandant
I am running PHP 5.3.3, with Apache 2.0 Handler and MySql Server 5.1.   My OS 
is Vista Home Premium 32 bit with SP2.

MySql works fine from the command prompt, Apache is running and PHP works.   
But I cannot access the mysqli classes.   This simple program:

?php

$mysqli = new mysqli(localhost, root, ##, testDB);#I've 
deliberately obliterated the password

if (mysqli_connect_errno()) {
 printf(Connect failed: %s\n, mysqli_connect_error());
 exit();
} else {
 printf(Host information: %s\n, mysqli_get_host_info($mysqli));
}
?

produces this error message:

Warning: mysqli::mysqli() [mysqli.mysqli]: [2002] A connection attempt failed 
because the connected party did not (trying to connect via 
tcp://localhost:3306) in C:\Apache\htdocs\mysqlconnect.php on line 3

Warning: mysqli::mysqli() [mysqli.mysqli]: (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 C:\Apache\htdocs\mysqlconnect.php on line 3

Fatal error: Maximum execution time of 30 seconds exceeded in 
C:\Apache\htdocs\mysqlconnect.php on line 3

I guess PHP cannot find the mysqli classes.   I've checked the phpinfo() output 
and discovered :

  Configuration File (php.ini) Path  C:\Windows  
  Loaded Configuration File  C:\PHP\php.ini  


I don't know if this ok.   I've tried changing the location of the loaded file 
to C:\Windows\php.ini, but to no avail, and I don't know how to change the 
location of the config file.

I am obviously doing something wrong, but I don't know what.   Can anyone help?

Ironically, everything worked perfectly before I upgraded to PHP 5.3.3!

Re: [PHP] Connecting to MySql with PHP

2010-10-04 Thread a...@ashleysheridan.co.uk
Have you installed the php mysql module? Basically, it tells php how to connect 
to mysql.

This question has come up a few times this week, have you tried installing 
something like xampp or easyphp rather than the individual software components: 
Apache, php  mysql.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: sueandant hollandsath...@tiscali.co.uk
Date: Mon, Oct 4, 2010 22:08
Subject: [PHP] Connecting to MySql with PHP
To: php-general@lists.php.net

I am running PHP 5.3.3, with Apache 2.0 Handler and MySql Server 5.1.   My OS 
is Vista Home Premium 32 bit with SP2.

MySql works fine from the command prompt, Apache is running and PHP works.   
But I cannot access the mysqli classes.   This simple program:

?php

$mysqli = new mysqli(localhost, root, ##, testDB);#I've 
deliberately obliterated the password

if (mysqli_connect_errno()) {
 printf(Connect failed: %s\n, mysqli_connect_error());
 exit();
} else {
 printf(Host information: %s\n, mysqli_get_host_info($mysqli));
}
?

produces this error message:

Warning: mysqli::mysqli() [mysqli.mysqli]: [2002] A connection attempt failed 
because the connected party did not (trying to connect via 
tcp://localhost:3306) in C:\Apache\htdocs\mysqlconnect.php on line 3

Warning: mysqli::mysqli() [mysqli.mysqli]: (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 C:\Apache\htdocs\mysqlconnect.php on line 3

Fatal error: Maximum execution time of 30 seconds exceeded in 
C:\Apache\htdocs\mysqlconnect.php on line 3

I guess PHP cannot find the mysqli classes.   I've checked the phpinfo() output 
and discovered :

  Configuration File (php.ini) Path  C:\Windows  
  Loaded Configuration File  C:\PHP\php.ini  


I don't know if this ok.   I've tried changing the location of the loaded file 
to C:\Windows\php.ini, but to no avail, and I don't know how to change the 
location of the config file.

I am obviously doing something wrong, but I don't know what.   Can anyone help?

Ironically, everything worked perfectly before I upgraded to PHP 5.3.3!

Re: [PHP] Connecting to MySql with PHP

2010-10-04 Thread mrfroasty
 The code execute fine on my LAMP server, but I am wondering does
localhost really works on Windows ?As this on MAC you need to actually
tell a complete path.On MAC with Zend-Server I had to mention something
like /var/tmp/mysql 

Anyways, by looking on the error it might be mysql server is not
accessed...Can you actually access the myql server with anything else
like phpmyadmin or cli ?

Gr
mrfroasty




On 10/04/2010 11:21 PM, a...@ashleysheridan.co.uk wrote:
 Have you installed the php mysql module? Basically, it tells php how to 
 connect to mysql.

 This question has come up a few times this week, have you tried installing 
 something like xampp or easyphp rather than the individual software 
 components: Apache, php  mysql.

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk

 - Reply message -
 From: sueandant hollandsath...@tiscali.co.uk
 Date: Mon, Oct 4, 2010 22:08
 Subject: [PHP] Connecting to MySql with PHP
 To: php-general@lists.php.net

 I am running PHP 5.3.3, with Apache 2.0 Handler and MySql Server 5.1.   My OS 
 is Vista Home Premium 32 bit with SP2.

 MySql works fine from the command prompt, Apache is running and PHP works.   
 But I cannot access the mysqli classes.   This simple program:

 ?php

 $mysqli = new mysqli(localhost, root, ##, testDB);#I've 
 deliberately obliterated the password

 if (mysqli_connect_errno()) {
  printf(Connect failed: %s\n, mysqli_connect_error());
  exit();
 } else {
  printf(Host information: %s\n, mysqli_get_host_info($mysqli));
 }
 ?

 produces this error message:

 Warning: mysqli::mysqli() [mysqli.mysqli]: [2002] A connection attempt failed 
 because the connected party did not (trying to connect via 
 tcp://localhost:3306) in C:\Apache\htdocs\mysqlconnect.php on line 3

 Warning: mysqli::mysqli() [mysqli.mysqli]: (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 C:\Apache\htdocs\mysqlconnect.php on line 3

 Fatal error: Maximum execution time of 30 seconds exceeded in 
 C:\Apache\htdocs\mysqlconnect.php on line 3

 I guess PHP cannot find the mysqli classes.   I've checked the phpinfo() 
 output and discovered :

   Configuration File (php.ini) Path  C:\Windows  
   Loaded Configuration File  C:\PHP\php.ini  


 I don't know if this ok.   I've tried changing the location of the loaded 
 file to C:\Windows\php.ini, but to no avail, and I don't know how to change 
 the location of the config file.

 I am obviously doing something wrong, but I don't know what.   Can anyone 
 help?

 Ironically, everything worked perfectly before I upgraded to PHP 5.3.3!


-- 
Extra details:
OSS:Gentoo Linux
profile:x86
Hardware:msi geforce 8600GT asus p5k-se
location:/home/muhsin
language(s):C/C++,VB,VHDL,bash,PHP,SQL,HTML,CSS
Typo:40WPM
url:http://www.mzalendo.net
url:http://www.zanbytes.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php