How do configure PHP support for MySQL on Windows?

How do configure PHP support for MySQL on Windows?

am 23.07.2007 06:52:15 von Unknown

Hi,


How does one configure PHP support for MySQL on Windows?

My host operating system is Windows Server 2003.
1. I have installed Apache 2.2 via the msi installer
(apache_2.2.4-win32-x86-no_ssl.msi).
2. I have installed MySQL 5.1 via the windows installer
(mysql-5.1.20-bet-win32.zip).
3. I have installed PHP 5 via the msi installer
(php-5.2.3-win32-installer.msi)
4. I have enabled the php_mysql.dll extension inside of php.ini
5. I have ensured that libmysql.dll in on the system path.

I have done all of this correctly, but I still cannot open
a database from php script! What am I doing wrong? Can any one
please advise?


Please help a PHP/MySQL newbie.

Faithfully,
Sean B. Durkin
(s.durkin@{removeThis}gridsense.net

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

Re: How do configure PHP support for MySQL on Windows?

am 23.07.2007 07:08:52 von vikas batra

--0-1128725974-1185167332=:75983
Content-Type: text/plain; charset=ascii

Pls ensure that ur mysql service has ben started or not if not started then start it from control panel->Administrative tools->services. and then see the results. u r editing right php.ini or not, pls ensure also this one.


Vikas Batra
contact: +91-9818439935

----- Original Message ----
From: Sean B. Durkin
To: php-windows@lists.php.net
Sent: Sunday, 22 July, 2007 9:52:15 PM
Subject: [PHP-WIN] How do configure PHP support for MySQL on Windows?

Hi,


How does one configure PHP support for MySQL on Windows?

My host operating system is Windows Server 2003.
1. I have installed Apache 2.2 via the msi installer
(apache_2.2.4-win32-x86-no_ssl.msi).
2. I have installed MySQL 5.1 via the windows installer
(mysql-5.1.20-bet-win32.zip).
3. I have installed PHP 5 via the msi installer
(php-5.2.3-win32-installer.msi)
4. I have enabled the php_mysql.dll extension inside of php.ini
5. I have ensured that libmysql.dll in on the system path.

I have done all of this correctly, but I still cannot open
a database from php script! What am I doing wrong? Can any one
please advise?


Please help a PHP/MySQL newbie.

Faithfully,
Sean B. Durkin
(s.durkin@{removeThis}gridsense.net

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








Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools- 08.html/
--0-1128725974-1185167332=:75983--

Re: How do configure PHP support for MySQL on Windows?

am 23.07.2007 09:52:56 von Unknown

Vikas,

The MySQL is started. I have only one php.ini and it is in the correct
location.

My problem must be something else. But thanks anyway.

Faithfully,
Sean



vikas batra wrote:
> Pls ensure that ur mysql service has ben started or not if not started then start it from control panel->Administrative tools->services. and then see the results. u r editing right php.ini or not, pls ensure also this one.
>
>
> Vikas Batra
> contact: +91-9818439935
>
> ----- Original Message ----
> From: Sean B. Durkin
> To: php-windows@lists.php.net
> Sent: Sunday, 22 July, 2007 9:52:15 PM
> Subject: [PHP-WIN] How do configure PHP support for MySQL on Windows?
>
> Hi,
>
>
> How does one configure PHP support for MySQL on Windows?
>
> My host operating system is Windows Server 2003.
> 1. I have installed Apache 2.2 via the msi installer
> (apache_2.2.4-win32-x86-no_ssl.msi).
> 2. I have installed MySQL 5.1 via the windows installer
> (mysql-5.1.20-bet-win32.zip).
> 3. I have installed PHP 5 via the msi installer
> (php-5.2.3-win32-installer.msi)
> 4. I have enabled the php_mysql.dll extension inside of php.ini
> 5. I have ensured that libmysql.dll in on the system path.
>
> I have done all of this correctly, but I still cannot open
> a database from php script! What am I doing wrong? Can any one
> please advise?
>
>
> Please help a PHP/MySQL newbie.
>
> Faithfully,
> Sean B. Durkin
> (s.durkin@{removeThis}gridsense.net
>

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

Re: How do configure PHP support for MySQL on Windows?

am 23.07.2007 10:02:21 von Janet Valade

Sean B. Durkin wrote:

> Hi,
>
>
> How does one configure PHP support for MySQL on Windows?
>
> My host operating system is Windows Server 2003.
> 1. I have installed Apache 2.2 via the msi installer
> (apache_2.2.4-win32-x86-no_ssl.msi).
> 2. I have installed MySQL 5.1 via the windows installer
> (mysql-5.1.20-bet-win32.zip).
> 3. I have installed PHP 5 via the msi installer
> (php-5.2.3-win32-installer.msi)
> 4. I have enabled the php_mysql.dll extension inside of php.ini
> 5. I have ensured that libmysql.dll in on the system path.
>
> I have done all of this correctly, but I still cannot open
> a database from php script! What am I doing wrong? Can any one
> please advise?


What error message do you get?

Janet


>
>
> Please help a PHP/MySQL newbie.
>
> Faithfully,
> Sean B. Durkin
> (s.durkin@{removeThis}gridsense.net
>

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

Re: How do configure PHP support for MySQL on Windows?

am 23.07.2007 17:44:46 von Niel Archer

Hi

> The MySQL is started. I have only one php.ini and it is in the correct
> location.

That statement is only true, provided your not working under a
misconception, the usual cause of problems.

Your initial post told us very little useful info, just that you'd
install this, that and the other. Did you test each component along the
way to ensure it was working?

If so, what errors does PHP give when attempting to use a MySQl db?

You might try looking at this step by step guide also to see if you
missed anything

http://wamp.corephp.co.uk/

--
Niel Archer

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

Re: How do configure PHP support for MySQL on Windows?

am 24.07.2007 00:53:56 von Unknown

Niel,

Thanks for your advise. I have tested the Apache web server, and it is
working fine. I have tested MySQL through a console window, and used it
to create a database, and it is working fine. I have tested PHP on
Apache by viewing php pages, and it is working fine.

However if I use a php script to call any php mysql database functions,
then parsing bombs out without returning an error message. For example,
the following script returns an blank page to the browser. There is not
even an error message.


The following code is from Kevin Yank's book "Build Your Own Database
Driven Web-site using PHP and MySQL".
================================================


Our List of Jokes
content="text/html; charset=iso-8859-1" />


// Connect to the database server
$dbcnx = @mysql_connect('localhost', 'root', 'mypasswd');
if (!$dbcnx) {
exit('

Unable to connect to the ' .
'database server at this time.

');
}
// Select the jokes database
if (!@mysql_select_db('ijdb')) {
exit('

Unable to locate the joke ' .
'database at this time.

');
}
?>

Here are all the jokes in our database:



// Request the text of all the jokes
$result = @mysql_query('SELECT joketext FROM joke');
if (!$result) {
exit('

Error performing query: ' . mysql_error() . '

');
}
// Display the text of each joke in a paragraph
while ($row = mysql_fetch_array($result)) {
echo '

' . $row['joketext'] . '

';
}
?>



================================================

I have followed Kevin Yank's book, which is a step-by-step
guide.

Any ideas anyone?


Faithfully,
Sean B. Durkin

Niel Archer wrote:
> Hi
>
>> The MySQL is started. I have only one php.ini and it is in the correct
>> location.
>
> That statement is only true, provided your not working under a
> misconception, the usual cause of problems.
>
> Your initial post told us very little useful info, just that you'd
> install this, that and the other. Did you test each component along the
> way to ensure it was working?
>
> If so, what errors does PHP give when attempting to use a MySQl db?
>
> You might try looking at this step by step guide also to see if you
> missed anything
>
> http://wamp.corephp.co.uk/
>
> --
> Niel Archer

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

Re: How do configure PHP support for MySQL on Windows?

am 24.07.2007 00:55:45 von Unknown

Janet,

See my response to Vikas' message below.


Faithfully,
Sean B. Durkin

Janet Valade wrote:
> Sean B. Durkin wrote:
>
>> Hi,
>>
>>
>> How does one configure PHP support for MySQL on Windows?
>>
>> My host operating system is Windows Server 2003.
>> 1. I have installed Apache 2.2 via the msi installer
>> (apache_2.2.4-win32-x86-no_ssl.msi).
>> 2. I have installed MySQL 5.1 via the windows installer
>> (mysql-5.1.20-bet-win32.zip).
>> 3. I have installed PHP 5 via the msi installer
>> (php-5.2.3-win32-installer.msi)
>> 4. I have enabled the php_mysql.dll extension inside of php.ini
>> 5. I have ensured that libmysql.dll in on the system path.
>>
>> I have done all of this correctly, but I still cannot open
>> a database from php script! What am I doing wrong? Can any one
>> please advise?
>
>
> What error message do you get?
>
> Janet
>
>
>>
>>
>> Please help a PHP/MySQL newbie.
>>
>> Faithfully,
>> Sean B. Durkin
>> (s.durkin@{removeThis}gridsense.net
>>

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

Re: How do configure PHP support for MySQL on Windows?

am 24.07.2007 01:22:43 von Janet Valade

You may have your error messages turned off. Add the following code to
the top of your script to see if you get an error message that provides
some info about what is happening.

error_reporting(E_ALL);
ini_set("display_errors",1);

Janet


Sean B. Durkin wrote:

> Janet,
>
> See my response to Vikas' message below.
>
>
> Faithfully,
> Sean B. Durkin
>
> Janet Valade wrote:
>
>> Sean B. Durkin wrote:
>>
>>> Hi,
>>>
>>>
>>> How does one configure PHP support for MySQL on Windows?
>>>
>>> My host operating system is Windows Server 2003.
>>> 1. I have installed Apache 2.2 via the msi installer
>>> (apache_2.2.4-win32-x86-no_ssl.msi).
>>> 2. I have installed MySQL 5.1 via the windows installer
>>> (mysql-5.1.20-bet-win32.zip).
>>> 3. I have installed PHP 5 via the msi installer
>>> (php-5.2.3-win32-installer.msi)
>>> 4. I have enabled the php_mysql.dll extension inside of php.ini
>>> 5. I have ensured that libmysql.dll in on the system path.
>>>
>>> I have done all of this correctly, but I still cannot open
>>> a database from php script! What am I doing wrong? Can any one
>>> please advise?
>>
>>
>>
>> What error message do you get?
>>
>> Janet
>>
>>
>>>
>>>
>>> Please help a PHP/MySQL newbie.
>>>
>>> Faithfully,
>>> Sean B. Durkin
>>> (s.durkin@{removeThis}gridsense.net
>>>
>

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

Re: How do configure PHP support for MySQL on Windows?

am 25.07.2007 02:58:56 von Tularis

If that's literally from a book then I strongly suggest you burn the
book. I would never trust _anything_ learned from a book that actively
disables error-reporting on almost _all_ functions. Kick out all the @
operators and you might start seeing errors (they force PHP to ignore
them silently), which are 90% likely to resolve your problem.

- Tul

Sean B. Durkin wrote:
> Niel,
>
> Thanks for your advise. I have tested the Apache web server, and it is
> working fine. I have tested MySQL through a console window, and used it
> to create a database, and it is working fine. I have tested PHP on
> Apache by viewing php pages, and it is working fine.
>
> However if I use a php script to call any php mysql database functions,
> then parsing bombs out without returning an error message. For example,
> the following script returns an blank page to the browser. There is not
> even an error message.
>
>
> The following code is from Kevin Yank's book "Build Your Own Database
> Driven Web-site using PHP and MySQL".
> ================================================
>
>
> Our List of Jokes
> > content="text/html; charset=iso-8859-1" />
>
>
> > // Connect to the database server
> $dbcnx = @mysql_connect('localhost', 'root', 'mypasswd');
> if (!$dbcnx) {
> exit('

Unable to connect to the ' .
> 'database server at this time.

');
> }
> // Select the jokes database
> if (!@mysql_select_db('ijdb')) {
> exit('

Unable to locate the joke ' .
> 'database at this time.

');
> }
> ?>
>

Here are all the jokes in our database:


>

> > // Request the text of all the jokes
> $result = @mysql_query('SELECT joketext FROM joke');
> if (!$result) {
> exit('

Error performing query: ' . mysql_error() . '

');
> }
> // Display the text of each joke in a paragraph
> while ($row = mysql_fetch_array($result)) {
> echo '

' . $row['joketext'] . '

';
> }
> ?>
>

>
>
> ================================================
>
> I have followed Kevin Yank's book, which is a step-by-step
> guide.
>
> Any ideas anyone?
>
>
> Faithfully,
> Sean B. Durkin
>
> Niel Archer wrote:
>> Hi
>>
>>> The MySQL is started. I have only one php.ini and it is in the
>>> correct location.
>>
>> That statement is only true, provided your not working under a
>> misconception, the usual cause of problems.
>>
>> Your initial post told us very little useful info, just that you'd
>> install this, that and the other. Did you test each component along the
>> way to ensure it was working?
>>
>> If so, what errors does PHP give when attempting to use a MySQl db?
>>
>> You might try looking at this step by step guide also to see if you
>> missed anything
>> http://wamp.corephp.co.uk/
>>
>> --
>> Niel Archer

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

Re: How do configure PHP support for MySQL on Windows?

am 25.07.2007 04:13:10 von Unknown

Thanks M. Sokolewicz.

Yes, it is literally from the book.

Also, I turned on
[php]display_startup_errors=on
in my php.ini file, restarted Apache and got this interesting error message:
"Unable to load \php_mysql.dll - Invalid access to memory".

After googling around in other forums, I observed that this is a
common error, and it is most likely caused by incompatible versions
of PHP, php_mysql.dll and MySQL.

Do you agree? Would anyone else like to contribute an opinion as to
the cause of this error?


Anyway, I uninstalled everything, and started again with XAMPP
(http://www.apachefriends.org/en/xampp.html). XAMPP is just Apache,
PHP and MySQL all in one bundle. I installed it and it just works!


Faithfully,
Sean B. Durkin

M. Sokolewicz wrote:
> If that's literally from a book then I strongly suggest you burn the
> book. I would never trust _anything_ learned from a book that actively
> disables error-reporting on almost _all_ functions. Kick out all the @
> operators and you might start seeing errors (they force PHP to ignore
> them silently), which are 90% likely to resolve your problem.
>
> - Tul
>
> Sean B. Durkin wrote:
>> Niel,
>>
>> Thanks for your advise. I have tested the Apache web server, and it is
>> working fine. I have tested MySQL through a console window, and used it
>> to create a database, and it is working fine. I have tested PHP on
>> Apache by viewing php pages, and it is working fine.
>>
>> However if I use a php script to call any php mysql database functions,
>> then parsing bombs out without returning an error message. For example,
>> the following script returns an blank page to the browser. There is not
>> even an error message.
>>
>>
>> The following code is from Kevin Yank's book "Build Your Own Database
>> Driven Web-site using PHP and MySQL".
>> ================================================
>>
>>
>> Our List of Jokes
>> >> content="text/html; charset=iso-8859-1" />
>>
>>
>> >> // Connect to the database server
>> $dbcnx = @mysql_connect('localhost', 'root', 'mypasswd');
>> if (!$dbcnx) {
>> exit('

Unable to connect to the ' .
>> 'database server at this time.

');
>> }
>> // Select the jokes database
>> if (!@mysql_select_db('ijdb')) {
>> exit('

Unable to locate the joke ' .
>> 'database at this time.

');
>> }
>> ?>
>>

Here are all the jokes in our database:


>>

>> >> // Request the text of all the jokes
>> $result = @mysql_query('SELECT joketext FROM joke');
>> if (!$result) {
>> exit('

Error performing query: ' . mysql_error() . '

');
>> }
>> // Display the text of each joke in a paragraph
>> while ($row = mysql_fetch_array($result)) {
>> echo '

' . $row['joketext'] . '

';
>> }
>> ?>
>>

>>
>>
>> ================================================
>>
>> I have followed Kevin Yank's book, which is a step-by-step
>> guide.
>>
>> Any ideas anyone?
>>
>>
>> Faithfully,
>> Sean B. Durkin
>>
>> Niel Archer wrote:
>>> Hi
>>>
>>>> The MySQL is started. I have only one php.ini and it is in the
>>>> correct location.
>>>
>>> That statement is only true, provided your not working under a
>>> misconception, the usual cause of problems.
>>>
>>> Your initial post told us very little useful info, just that you'd
>>> install this, that and the other. Did you test each component along the
>>> way to ensure it was working?
>>>
>>> If so, what errors does PHP give when attempting to use a MySQl db?
>>>
>>> You might try looking at this step by step guide also to see if you
>>> missed anything
>>> http://wamp.corephp.co.uk/
>>>
>>> --
>>> Niel Archer

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