php-windows Digest 12 Jul 2007 07:27:29 -0000 Issue 3281
Topics (messages 28202 through 28208):
Re: Mysql_send.php
28202 by: Murphy, Matt
28203 by: Jacob Bergman
php default users
28204 by: Jacob Bergman
28205 by: Niel Archer
Unable to load dynamic library "C:\PHP\ext\php_mysql.dll" and Unable to load
dynamic library "C:\PHP\ext\php_mysqli.dll"
28206 by: Oman, Gregg
28207 by: Niel Archer
28208 by: Stut
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I already explained this error to you once, the MySQL server is
rejecting your connection. You need to talk to the person who set up the
MySQL server and have them allow connections from your host.
If you are the admin of this MySQL server, install phpmyadmin and figure
it out.
Matt
-----Original Message-----
From: Jacob Bergman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 10:34 AM
To: Janet Valade
Cc: [EMAIL PROTECTED]
Subject: [PHP-WIN] Mysql_send.php
When I try to run the mysql_send.php function from your website... from
the 3rd edition of the php and mysql for dummies, I get these errors:
************************************************************************
**
Warning: mysqli_connect() [function.mysqli-connect]: (00000/1130): Host
'PHP-AND-MYSQL.VMware.psd267.wednet.edu' is not allowed to connect to
this MySQL server in C:\xampp\htdocs\mysql_send.php on line 21
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given
in C:\xampp\htdocs\mysql_send.php on line 22 Database Selected:
Query:
Results
------------------------------------------------------------------------
--------
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given
in C:\xampp\htdocs\mysql_send.php on line 28
Error:
------------------------------------------------------------------------
--------
************************************************************************
****
The screen with the database name and and query comes up ok, but I get
what is displayed above as soon as I hit the submit query button.
Thanks for the help.
Jacob Bergman
Network Technician
Pullman School District #267
(509) 432-4012
[EMAIL PROTECTED]
-----Original Message-----
From: Janet Valade [mailto:[EMAIL PROTECTED]
Sent: Monday, July 09, 2007 10:53 AM
To: Jacob Bergman
Subject: Re: [PHP-WIN] Testing MySQL PHP connection
Here you go. Hope the editing marks aren't too confusing. The lines
through things don't mean they are crossed out. It means they are in a
different type face.
Janet
Jacob Bergman wrote:
> That would be great, thanks!
>
> Jacob Bergman
> Network Technician
> Pullman School District #267
> (509) 432-4012
> [EMAIL PROTECTED]
>
> -----Original Message-----
> From: Janet Valade [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 09, 2007 10:04 AM
> To: Jacob Bergman
> Subject: Re: [PHP-WIN] Testing MySQL PHP connection
>
> I have installed a document with complete, up-to-date instructions for
> installing PHP on my web site at janet.valade.com. This might be
helpful
>
> for you.
>
> Also, I have instructions that I have just written for installing from
> XAMPP on Windows. They are for the book I am writing now. I could send
> the XAMPP instructions to you if you would like.
>
> Janet
>
>
> Jacob Bergman wrote:
>
>
>>Thanks for all the help guys... but I think I am going to blow away
>
> what
>
>>I have so far and install wamp5. I want to be able to get on with
>
> your
>
>>book Janet :) Thanks for the help though. I'm sure I will have plenty
>>more questions.
>>
>>Jacob Bergman
>>Network Technician
>>Pullman School District #267
>>(509) 432-4012
>>[EMAIL PROTECTED]
>>
>>-----Original Message-----
>>From: Janet Valade [mailto:[EMAIL PROTECTED]
>>Sent: Monday, July 09, 2007 9:17 AM
>>To: Jacob Bergman
>>Subject: Re: [PHP-WIN] Testing MySQL PHP connection
>>
>>There error message means that the mysqli functions are not enabled.
>>This means one of two things: (1) you did not activate the mysqli
>>functions in php.ini by commenting the mysqli line. After editing
>>php.ini, you need to restart your web server. Also, be sure you are
>>editing the correct php.ini, as shown in the output of phpinfo().
>>
>>(2) PHP cannot the find one or both of the files: php_mysqli.dll
>>andlibmysqli.dll. The files must be located where PHP can find them.
>
> The
>
>>simplest way is to locate them in a folder that is in your system
>
> path.
>
>>If you added c:\php to your system path, copy them there. Or you can
>>copy them to your windows\system32 folder.
>>
>>Janet
>>
>>
>>Jacob Bergman wrote:
>>
>>
>>
>>>While trying to connect to the mysqll database with php, I use the
>>>following file:
>>>
>>>
>>>
>>><?php
>>>
>>>/* Program: mysql_up.php
>>>
>>>* Desc: Connects to MySQL Server and
>>>
>>>* outputs settings.
>>>
>>>*/
>>>
>>>echo "<html>
>>>
>>> <head><title>Test MySQL</title></head>
>>>
>>> <body>";
>>>
>>>$host="PHP-AND-MYSQL";
>>>
>>>$user="root";
>>>
>>>$password="Britt9906";
>>>
>>>
>>>
>>>$cxn = mysqli_connect($host,$user,$password);
>>>
>>>$sql="SHOW STATUS";
>>>
>>>$result = mysqli_query($cxn,$sql);
>>>
>>>if($result == false)
>>>
>>>{
>>>
>>> echo "<h4>Error: ".mysqli_error($cxn)."</h4>";
>>>
>>>}
>>>
>>>else
>>>
>>>{
>>>
>>> /* Table that displays the results */
>>>
>>> echo "<table border='1'>
>>>
>>> <tr><th>Variable_name</th>
>>>
>>> <th>Value</th></tr>";
>>>
>>> for($i = 0; $i < mysqli_num_rows($result); $i++)
>>>
>>> {
>>>
>>> echo "<tr>";
>>>
>>> $row_array = mysqli_fetch_row($result);
>>>
>>> for($j = 0;$j < mysqli_num_fields($result);$j++)
>>>
>>> {
>>>
>>> echo "<td>".$row_array[$j]."</td>\n";
>>>
>>> }
>>>
>>> }
>>>
>>> echo "</table>";
>>>
>>>}
>>>
>>>?>
>>>
>>></body></html>
>>>
>>>
>>>
>>>When I access this file I I get "Fatal error: Call to undefined
>>
>>function
>>
>>
>>>mysqli_connect() in C:\Program Files\Apache
>>>Group\Apache2\htdocs\mysql_up.php on line 13"
>>>
>>>
>>>
>>>Not sure what is wrong... I'm pretty new to all this and grabbed
this
>>>out of a book. Thanks for the help!
>>>
>>>
>>>
>>>Jacob Bergman
>>>
>>>Network Technician
>>>
>>>Pullman School District #267
>>>
>>>(509) 432-4012
>>>
>>>[EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
--
Janet Valade -- janet.valade.com
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Thanks that made it much clearer... I was just being dumb and in the php
file where I was supposed to change the "$host="hostname"" line, I was
putting the actual name of my machine instead of just "localhost". Once
I changed that everything seems to be working now. Obviously it
couldn't find a user that was [EMAIL PROTECTED] because it didn't
exist. Thanks a bunch!!
Jacob Bergman
Network Technician
Pullman School District #267
(509) 432-4012
[EMAIL PROTECTED]
-----Original Message-----
From: Janet Valade [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 9:03 AM
To: Jacob Bergman
Subject: Re: Mysql_send.php
The problem is the first error message. The others are just complaining
because the connect function wasn't successful.
The problem is with your MySQL account name. Chapter 5 explains MySQL
accounts. MySQL accounts are two part account names: the account and the
host that it is allowed to connect from. Such as [EMAIL PROTECTED] The
error message shows that MySQL believes you are connecting from the host
PHP-AND-MYSQL.VMware.psd267.wednet.edu. I don't know where it gets that
host, but the account you are using is not allowed to connect from that
host. You need to set up a valid account.
Good luck,
Janet
Jacob Bergman wrote:
> When I try to run the mysql_send.php function from your website...
from
> the 3rd edition of the php and mysql for dummies, I get these errors:
>
>
************************************************************************
> **
> Warning: mysqli_connect() [function.mysqli-connect]: (00000/1130):
Host
> 'PHP-AND-MYSQL.VMware.psd267.wednet.edu' is not allowed to connect to
> this MySQL server in C:\xampp\htdocs\mysql_send.php on line 21
>
> Warning: mysqli_query() expects parameter 1 to be mysqli, boolean
given
> in C:\xampp\htdocs\mysql_send.php on line 22
> Database Selected:
> Query:
> Results
>
>
------------------------------------------------------------------------
> --------
>
> Warning: mysqli_error() expects parameter 1 to be mysqli, boolean
given
> in C:\xampp\htdocs\mysql_send.php on line 28
>
> Error:
>
>
------------------------------------------------------------------------
> --------
>
************************************************************************
> ****
>
> The screen with the database name and and query comes up ok, but I get
> what is displayed above as soon as I hit the submit query button.
> Thanks for the help.
>
> Jacob Bergman
> Network Technician
> Pullman School District #267
> (509) 432-4012
> [EMAIL PROTECTED]
>
> -----Original Message-----
> From: Janet Valade [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 09, 2007 10:53 AM
> To: Jacob Bergman
> Subject: Re: [PHP-WIN] Testing MySQL PHP connection
>
> Here you go. Hope the editing marks aren't too confusing. The lines
> through things don't mean they are crossed out. It means they are in a
> different type face.
>
> Janet
>
>
>
>
>
>
> Jacob Bergman wrote:
>
>
>>That would be great, thanks!
>>
>>Jacob Bergman
>>Network Technician
>>Pullman School District #267
>>(509) 432-4012
>>[EMAIL PROTECTED]
>>
>>-----Original Message-----
>>From: Janet Valade [mailto:[EMAIL PROTECTED]
>>Sent: Monday, July 09, 2007 10:04 AM
>>To: Jacob Bergman
>>Subject: Re: [PHP-WIN] Testing MySQL PHP connection
>>
>>I have installed a document with complete, up-to-date instructions for
>
>
>>installing PHP on my web site at janet.valade.com. This might be
>
> helpful
>
>>for you.
>>
>>Also, I have instructions that I have just written for installing from
>
>
>>XAMPP on Windows. They are for the book I am writing now. I could send
>
>
>>the XAMPP instructions to you if you would like.
>>
>>Janet
>>
>>
>>Jacob Bergman wrote:
>>
>>
>>
>>>Thanks for all the help guys... but I think I am going to blow away
>>
>>what
>>
>>
>>>I have so far and install wamp5. I want to be able to get on with
>>
>>your
>>
>>
>>>book Janet :) Thanks for the help though. I'm sure I will have
plenty
>>>more questions.
>>>
>>>Jacob Bergman
>>>Network Technician
>>>Pullman School District #267
>>>(509) 432-4012
>>>[EMAIL PROTECTED]
>>>
>>>-----Original Message-----
>>>From: Janet Valade [mailto:[EMAIL PROTECTED]
>>>Sent: Monday, July 09, 2007 9:17 AM
>>>To: Jacob Bergman
>>>Subject: Re: [PHP-WIN] Testing MySQL PHP connection
>>>
>>>There error message means that the mysqli functions are not enabled.
>>>This means one of two things: (1) you did not activate the mysqli
>>>functions in php.ini by commenting the mysqli line. After editing
>>>php.ini, you need to restart your web server. Also, be sure you are
>>>editing the correct php.ini, as shown in the output of phpinfo().
>>>
>>>(2) PHP cannot the find one or both of the files: php_mysqli.dll
>>>andlibmysqli.dll. The files must be located where PHP can find them.
>>
>>The
>>
>>
>>>simplest way is to locate them in a folder that is in your system
>>
>>path.
>>
>>
>>>If you added c:\php to your system path, copy them there. Or you can
>>>copy them to your windows\system32 folder.
>>>
>>>Janet
>>>
>>>
>>>Jacob Bergman wrote:
>>>
>>>
>>>
>>>
>>>>While trying to connect to the mysqll database with php, I use the
>>>>following file:
>>>>
>>>>
>>>>
>>>><?php
>>>>
>>>>/* Program: mysql_up.php
>>>>
>>>>* Desc: Connects to MySQL Server and
>>>>
>>>>* outputs settings.
>>>>
>>>>*/
>>>>
>>>>echo "<html>
>>>>
>>>> <head><title>Test MySQL</title></head>
>>>>
>>>> <body>";
>>>>
>>>>$host="PHP-AND-MYSQL";
>>>>
>>>>$user="root";
>>>>
>>>>$password="Britt9906";
>>>>
>>>>
>>>>
>>>>$cxn = mysqli_connect($host,$user,$password);
>>>>
>>>>$sql="SHOW STATUS";
>>>>
>>>>$result = mysqli_query($cxn,$sql);
>>>>
>>>>if($result == false)
>>>>
>>>>{
>>>>
>>>> echo "<h4>Error: ".mysqli_error($cxn)."</h4>";
>>>>
>>>>}
>>>>
>>>>else
>>>>
>>>>{
>>>>
>>>> /* Table that displays the results */
>>>>
>>>> echo "<table border='1'>
>>>>
>>>> <tr><th>Variable_name</th>
>>>>
>>>> <th>Value</th></tr>";
>>>>
>>>> for($i = 0; $i < mysqli_num_rows($result); $i++)
>>>>
>>>> {
>>>>
>>>> echo "<tr>";
>>>>
>>>> $row_array = mysqli_fetch_row($result);
>>>>
>>>> for($j = 0;$j < mysqli_num_fields($result);$j++)
>>>>
>>>> {
>>>>
>>>> echo "<td>".$row_array[$j]."</td>\n";
>>>>
>>>> }
>>>>
>>>> }
>>>>
>>>> echo "</table>";
>>>>
>>>>}
>>>>
>>>>?>
>>>>
>>>></body></html>
>>>>
>>>>
>>>>
>>>>When I access this file I I get "Fatal error: Call to undefined
>>>
>>>function
>>>
>>>
>>>
>>>>mysqli_connect() in C:\Program Files\Apache
>>>>Group\Apache2\htdocs\mysql_up.php on line 13"
>>>>
>>>>
>>>>
>>>>Not sure what is wrong... I'm pretty new to all this and grabbed
>
> this
>
>>>>out of a book. Thanks for the help!
>>>>
>>>>
>>>>
>>>>Jacob Bergman
>>>>
>>>>Network Technician
>>>>
>>>>Pullman School District #267
>>>>
>>>>(509) 432-4012
>>>>
>>>>[EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>
>
--
Janet Valade -- janet.valade.com
--- End Message ---
--- Begin Message ---
So here's a question... I installed Xampp and was messing around with
phpmyadmin. I decided that I would delete the pma user that was created
(root and pma on the localhost were the two users created by default).
After I did this, I can no longer authenticate into phpmyadmin like I
was before by using the root account... it tells me I have a bad
username/password, which I know I don't since I use the same account to
just get onto the Xampp main page. Can anyone tell me why this is, and
if I can fix it or not without re-installing Xampp. Thanks a bunch!!
Jacob Bergman
Network Technician
Pullman School District #267
(509) 432-4012
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi
In case you forgot, this is a PHP list. I suggest you direct that
question to what ever support Xampp/PHPMyAdmin offers. Deleting one of
the default users to your MySQL database, definitely isn't a PHP
question.
--
Niel Archer
--- End Message ---
--- Begin Message ---
Stut,
I found your e-mail address while looking through various PHP\MYSQL
connect messages at PHP.net and hoped you could help me or direct me to
someone who can. I have been struggling to get MySQL modules working
with PHP 5 and have completed the following:
1.) Uncommented the php_mysql.dll & php_mysqli.dll extensions in the
php.ini file.
2.) Set the extension_dir = C: \PHP\ext in the php.ini and set the
php_mysql.dll (5-31-2007), php_mysqli.dll (5-31-2007), & libmysql.dll
(10-22-2006) in this directory. Libmysql.dll also resides under the
Windows directory and is a copied file.
3.) Set an environment variable for the PATH to C:\Program
Files\PHP& C:\Program Files\PHP\ext. PHPRC variable to C:\Program
Files\PHP\
4.) Ran Dependency Walker against the php.exe and found all required
..dlls to be present.
5.) Ran phpinfo and find no reference to MySQL within it.
6.) PHP Version 5.2.3, MySQL Version 5.1.11(Community), Apache
Version 2.2.4
7.) Display_errors & Display_startup_errors= ON in php.ini.
Any assistance you can offer would be greatly appreciated.
Gregg Oman
System Admin.
Dwyer Instruments Inc.
(219) 879-8868 x-331
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi
Why do you have a "C:\PHP\" and a "C:\Program Files\PHP\" directories?
It really should be one or the other.
The date on the libmysql.dll should be the same as the other two dlls as
they are part of the same PHP install. I would leave it in the PHP base
directory too.
Check the extension_dir listed by phpinfo() to be sure it's using the
one you think it is.
--
Niel Archer
--- End Message ---
--- Begin Message ---
Oman, Gregg wrote:
1.) Uncommented the php_mysql.dll & php_mysqli.dll extensions in the
php.ini file.
2.) Set the extension_dir = C: \PHP\ext in the php.ini and set the
php_mysql.dll (5-31-2007), php_mysqli.dll (5-31-2007), & libmysql.dll
(10-22-2006) in this directory. Libmysql.dll also resides under the
Windows directory and is a copied file.
3.) Set an environment variable for the PATH to C:\Program
Files\PHP& C:\Program Files\PHP\ext. PHPRC variable to C:\Program Files\PHP\
4.) Ran Dependency Walker against the php.exe and found all required
.dlls to be present.
5.) Ran phpinfo and find no reference to MySQL within it.
6.) PHP Version 5.2.3, MySQL Version 5.1.11(Community), Apache
Version 2.2.4
7.) Display_errors & Display_startup_errors= ON in php.ini.
Are you sure you edited the right php.ini? Check the output from phpinfo
for where it's expecting to find it. Also you make no mention of
restarting Apache after you modified the ini file.
-Stut
--
http://stut.net/
--- End Message ---