PHP and MySQL

PHP and MySQL

am 06.01.2006 17:05:01 von Don Lancaster

------_=_NextPart_001_01C612DA.F30D8D80
Content-Type: text/plain;
charset="iso-8859-1"

Hi all - here's the story... I installed MySQL 5 on my Windows XP computer
and everything seems to work splendidly. I then installed Apache, and that
worked wonderfully also. I added PHP5, and tested it with a simple "echo"
statement and it worked marvelously. In a rapture, I tried to connect to a
MySQL database using mysql_connect and I got an error message that in effect
said Apache didn't know what the heck the function was. I remembered that
PHP5 doesn't automatically include MySQL support, so I went to the PHP
webpage and did the two things they stated I needed to do (put the php.ini
file in the c:\windows directory, which it already was, and add it to the
PATH environmental variable). I also "uncommented" the extension
php_mysql.dll in the php.ini file. But it still doesn't work! I'm at my
wit's end. What am I doing wrong? One book says that I should put the
libmysql.dll in the c:\windows directory, but I'm wondering if it should be
in the extensions folder (c:\php\ext). Is this correct? Can someone give
me some advice (besides "Use ODBC instead")?

Donald J. Lancaster
Environmental Standards, Inc.
1140 Valley Forge Road
PO Box 810
Valley Forge, PA 19482
phone: 610 935 5577
fax: 610 935 5583
www.envstd.com



------_=_NextPart_001_01C612DA.F30D8D80--

RE: PHP and MySQL

am 06.01.2006 19:41:25 von Lawson Cronlund

Don,

I'm reading up on the integration of MySQL, Apache, and PHP in a book =
called
"How to Do Everything with PHP and MySQL" by Vikram Vaswani
(McGraw-Hill/Osborne) which lists several steps to configure the =
connection
between Apache and PHP. Since I haven't reached the point of doing this
yet, I can't say if it works, but here are the steps Vikram lists:

1. Extract the PHP distribution file to c:\php.
2. Copy the file php.ini-recommended from c:\php to c:\windows as =
php.ini.
3. Copy the file libmysql.dll from c:\php to c:\windows\system32.
4. Edit the c:\windows\php.ini file as follows:
change the string 'extension_dir =3D "./"' to 'extension_dir =3D
"c"\php\ext"'.
Delete the ';' from the line ';extension=3Dphp_mysql.dll
5. Open the Apache configuration file "httpd.conf" (in the Apache/conf/
subdirectory of the Apache installation directory) and add the following
lines to it:
AddType application/x-httpd-php .php
LoadModule php5_module "c:\php\php5apache.dll"
SetEnv PHPRC C:\windows

Once again, I haven't reached the point of trying this yet but the book
seems clear and straightforward in its description.

You may find that a copy of this book helps with general questions. It =
lays
information out in a way that I can understand. Many technical books =
are a
challenge in understanding obscure terms for simple concepts but this =
book
doesn't seem to have that defect.

Regards.



Lawson
lawson@vrtinc.com
+1(480)308-0641 (Voice)
+1(602)996-0376 (Fax)
=20

-----Original Message-----
From: Don Lancaster [mailto:DLancaster@envstd.com]=20
Sent: Friday, January 06, 2006 9:05 AM
To: win32@lists.mysql.com
Subject: PHP and MySQL


Hi all - here's the story... I installed MySQL 5 on my Windows XP =
computer
and everything seems to work splendidly. I then installed Apache, and =
that
worked wonderfully also. I added PHP5, and tested it with a simple =
"echo"
statement and it worked marvelously. In a rapture, I tried to connect =
to a
MySQL database using mysql_connect and I got an error message that in =
effect
said Apache didn't know what the heck the function was. I remembered =
that
PHP5 doesn't automatically include MySQL support, so I went to the PHP
webpage and did the two things they stated I needed to do (put the =
php.ini
file in the c:\windows directory, which it already was, and add it to =
the
PATH environmental variable). I also "uncommented" the extension
php_mysql.dll in the php.ini file. But it still doesn't work! I'm at =
my
wit's end. What am I doing wrong? One book says that I should put the
libmysql.dll in the c:\windows directory, but I'm wondering if it should =
be
in the extensions folder (c:\php\ext). Is this correct? Can someone =
give
me some advice (besides "Use ODBC instead")? =20
=20
Donald J. Lancaster
Environmental Standards, Inc.
1140 Valley Forge Road
PO Box 810
Valley Forge, PA 19482
phone: 610 935 5577
fax: 610 935 5583
www.envstd.com =20
=20
=20


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

RE: PHP and MySQL

am 06.01.2006 20:42:01 von Don Lancaster

------_=_NextPart_001_01C612F9.43B2DD30
Content-Type: text/plain;
charset="iso-8859-1"

Thanks, Lawson! That looks great, I'll print that out for future reference.
My book didn't have Step 4 or the "Set PHPRC" task in Step 5 in it. And
Step 3 was different in my book too (it said to copy this to c:\windows). I
figured all this out with the help of a couple people on the mailing list
(Geoff and Janet, my public thanks to you!). Thanks again, Lawson! - Don

-----Original Message-----
From: Lawson Cronlund [mailto:lawson@vrtinc.com]
Sent: Friday, January 06, 2006 1:41 PM
To: 'Don Lancaster'; win32@lists.mysql.com
Subject: RE: PHP and MySQL


Don,

I'm reading up on the integration of MySQL, Apache, and PHP in a book called
"How to Do Everything with PHP and MySQL" by Vikram Vaswani
(McGraw-Hill/Osborne) which lists several steps to configure the connection
between Apache and PHP. Since I haven't reached the point of doing this
yet, I can't say if it works, but here are the steps Vikram lists:

1. Extract the PHP distribution file to c:\php.
2. Copy the file php.ini-recommended from c:\php to c:\windows as php.ini.
3. Copy the file libmysql.dll from c:\php to c:\windows\system32.
4. Edit the c:\windows\php.ini file as follows:
change the string 'extension_dir = "./"' to 'extension_dir =
"c"\php\ext"'.
Delete the ';' from the line ';extension=php_mysql.dll
5. Open the Apache configuration file "httpd.conf" (in the Apache/conf/
subdirectory of the Apache installation directory) and add the following
lines to it:
AddType application/x-httpd-php .php
LoadModule php5_module "c:\php\php5apache.dll"
SetEnv PHPRC C:\windows

Once again, I haven't reached the point of trying this yet but the book
seems clear and straightforward in its description.

You may find that a copy of this book helps with general questions. It lays
information out in a way that I can understand. Many technical books are a
challenge in understanding obscure terms for simple concepts but this book
doesn't seem to have that defect.

Regards.



Lawson
lawson@vrtinc.com
+1(480)308-0641 (Voice)
+1(602)996-0376 (Fax)


-----Original Message-----
From: Don Lancaster [mailto:DLancaster@envstd.com]
Sent: Friday, January 06, 2006 9:05 AM
To: win32@lists.mysql.com
Subject: PHP and MySQL


Hi all - here's the story... I installed MySQL 5 on my Windows XP computer
and everything seems to work splendidly. I then installed Apache, and that
worked wonderfully also. I added PHP5, and tested it with a simple "echo"
statement and it worked marvelously. In a rapture, I tried to connect to a
MySQL database using mysql_connect and I got an error message that in effect
said Apache didn't know what the heck the function was. I remembered that
PHP5 doesn't automatically include MySQL support, so I went to the PHP
webpage and did the two things they stated I needed to do (put the php.ini
file in the c:\windows directory, which it already was, and add it to the
PATH environmental variable). I also "uncommented" the extension
php_mysql.dll in the php.ini file. But it still doesn't work! I'm at my
wit's end. What am I doing wrong? One book says that I should put the
libmysql.dll in the c:\windows directory, but I'm wondering if it should be
in the extensions folder (c:\php\ext). Is this correct? Can someone give
me some advice (besides "Use ODBC instead")?

Donald J. Lancaster
Environmental Standards, Inc.
1140 Valley Forge Road
PO Box 810
Valley Forge, PA 19482
phone: 610 935 5577
fax: 610 935 5583
www.envstd.com



------_=_NextPart_001_01C612F9.43B2DD30--

Re: PHP and MySQL

am 06.01.2006 21:38:14 von kthorson

Don Lancaster wrote:

>Hi all - here's the story... I installed MySQL 5 on my Windows XP computer
>and everything seems to work splendidly. I then installed Apache, and that
>worked wonderfully also. I added PHP5, and tested it with a simple "echo"
>statement and it worked marvelously. In a rapture, I tried to connect to a
>MySQL database using mysql_connect and I got an error message that in effect
>said Apache didn't know what the heck the function was. I remembered that
>PHP5 doesn't automatically include MySQL support, so I went to the PHP
>webpage and did the two things they stated I needed to do (put the php.ini
>file in the c:\windows directory, which it already was, and add it to the
>PATH environmental variable). I also "uncommented" the extension
>php_mysql.dll in the php.ini file. But it still doesn't work! I'm at my
>wit's end. What am I doing wrong? One book says that I should put the
>libmysql.dll in the c:\windows directory, but I'm wondering if it should be
>in the extensions folder (c:\php\ext). Is this correct? Can someone give
>me some advice (besides "Use ODBC instead")?
>
>
>

This is more of a PHP question. Ask on that list for more help.

I believe you actually want the extension dir in PATH, not php.ini - you
shouldn't need to bother placing the mysql dll in the windows directory
if the extension dir (where the dll is) is in the PATH. Also, do a
phpinfo() and make sure that the path it give to php.ini is where you
think it is. Make sure the php_mysql.dll is in the extension directory,
and that you have the correct path for the extension directory in
php.ini. (By the way, I believe you want the mysqli library. The mysql
library is for versions earlier than 4.1.)


kgt


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: PHP and MySQL

am 07.01.2006 00:53:58 von LE Backup

Contrary to belief, and the installation documentation (and I know I'll
confuse this poor person so kinda ignore me, but for everyone else...)

You do NOT need to put any of these files in the %windir% or %system%,
matter of a fact our machine build policies will NOT allow any NON-Microsoft
product to install ANYTHING in the %windir%, and if it insists, we simply
will not use it.

For WAMP setup, we left the libmysql.dll and libmysqli.dll in the apache/bin
dir.

Cheers,

James Friesen, CIO

Lucretia Enterprises
"Our World Is Here..."
Info at lucretia dot ca
http://lucretia.ca


> I'm reading up on the integration of MySQL, Apache, and PHP
> in a book called "How to Do Everything with PHP and MySQL" by
> Vikram Vaswani
> (McGraw-Hill/Osborne) which lists several steps to configure
> the connection between Apache and PHP. Since I haven't
> reached the point of doing this yet, I can't say if it works,
> but here are the steps Vikram lists:
>
> 1. Extract the PHP distribution file to c:\php.
> 2. Copy the file php.ini-recommended from c:\php to
> c:\windows as php.ini.
> 3. Copy the file libmysql.dll from c:\php to c:\windows\system32.
> 4. Edit the c:\windows\php.ini file as follows:
> change the string 'extension_dir = "./"' to
> 'extension_dir = "c"\php\ext"'.
> Delete the ';' from the line ';extension=php_mysql.dll 5.
> Open the Apache configuration file "httpd.conf" (in the
> Apache/conf/ subdirectory of the Apache installation
> directory) and add the following lines to it:
> AddType application/x-httpd-php .php
> LoadModule php5_module "c:\php\php5apache.dll"
> SetEnv PHPRC C:\windows



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: PHP and MySQL

am 07.01.2006 02:19:28 von Dave Schuppert

The old DOS path statement still works. I got stuck once by having
duplicate files in the path an modifying the second file in the path.

The last time I loaded WAMP nothing worked correctly. I am just
starting a new project and will have to load everything from scratch
quite soon, so I'm interested in what you find. The PHP group in
Chicago disbanded, so I have no one local to work with.

-dave

At 05:53 PM 1/6/2006, LE Backup wrote:
>Contrary to belief, and the installation documentation (and I know I'll
>confuse this poor person so kinda ignore me, but for everyone else...)
>
>You do NOT need to put any of these files in the %windir% or %system%,
>matter of a fact our machine build policies will NOT allow any NON-Microsoft
>product to install ANYTHING in the %windir%, and if it insists, we simply
>will not use it.
>
>For WAMP setup, we left the libmysql.dll and libmysqli.dll in the apache/bin
>dir.
>
>Cheers,
>
>James Friesen, CIO
>
>Lucretia Enterprises
>"Our World Is Here..."
>Info at lucretia dot ca
>http://lucretia.ca
>
>
> > I'm reading up on the integration of MySQL, Apache, and PHP
> > in a book called "How to Do Everything with PHP and MySQL" by
> > Vikram Vaswani
> > (McGraw-Hill/Osborne) which lists several steps to configure
> > the connection between Apache and PHP. Since I haven't
> > reached the point of doing this yet, I can't say if it works,
> > but here are the steps Vikram lists:
> >
> > 1. Extract the PHP distribution file to c:\php.
> > 2. Copy the file php.ini-recommended from c:\php to
> > c:\windows as php.ini.
> > 3. Copy the file libmysql.dll from c:\php to c:\windows\system32.
> > 4. Edit the c:\windows\php.ini file as follows:
> > change the string 'extension_dir = "./"' to
> > 'extension_dir = "c"\php\ext"'.
> > Delete the ';' from the line ';extension=php_mysql.dll 5.
> > Open the Apache configuration file "httpd.conf" (in the
> > Apache/conf/ subdirectory of the Apache installation
> > directory) and add the following lines to it:
> > AddType application/x-httpd-php .php
> > LoadModule php5_module "c:\php\php5apache.dll"
> > SetEnv PHPRC C:\windows
>
>
>
>--
>MySQL Windows Mailing List
>For list archives: http://lists.mysql.com/win32
>To unsubscribe: http://lists.mysql.com/win32?unsub=dwsmark@ameritech.net


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: PHP and MySQL

am 07.01.2006 20:52:32 von Larry Elliott

I am running PHP 5.1.1, MySQL 5.0.17, and Apache 1.3.34. I am also a
amateur, not a professional programmer. I do however, have some strong
opinions.
1. Use the documentation on how to install for windows XP that is =
included
with the programs. The books never have the current instructions. They =
are
good for how to use the program once installed, but not for the initial
installation.
2. Don't use the windows installer for MySQL. Download the
mysql-noinstall-5.0.17-win32.zip file, unzip into c:\mysql then follow =
the
directions in the section about installing for Windows XP. Create the
My.ini file in the c:\mysql directory.
3. Here are the salient lines in the My.ini file running on my =
computer:
[mysqld]
basedir =3D c:/mysql
bind-address =3D 127.0.0.1
port =3D 3306
[WinMySQLAdmin]
Server=3DC:/mySQL/bin/mysqld-nt.exe
The bind-address line is critical for the windows setup and not included =
in
the recommended ini file. You will need to add the line manually.
4. Download and install mysql-administrator from the MYSQL download =
site.
Once MySQL is installed on the computer run MySQL-Administrator to set =
the
root password, create other users, grant privilege and to back up your
database(s). You can also download and install mysql-query-browser from =
the
MySQL download site and execute queries\view results in the windows GUI.
Very useful in verifying that the MySQL service is running properly
5. Next install Apache and check to make sure it is running properly. =
The
install directions for the 1.3 series work well and are clear. I did =
not
succeed in my attempt to get Apache 2.0 running here at home.
6. Install PHP into the directory c:\php. Create php.ini in the c:\php
directory. You will need to adjust the extension_dir statement in the
recommended ini file to suit a windows installation. Here is what I use
; Directory in which the loadable extensions (modules) reside.
extension_dir =3D C:/PHP/ext
I recommend you activate the 'extension=3Dphp_mbstring.dll' line. You =
have to
activate the MySQL extension (delete the ';' from the start of the =
line).
The mbstring functions are useful in running phpMyAdmin.
7. Edit the httpd.conf file in the Apache/conf directory to enable =
Apache's
use of PHP. The PHP documentation gives explicit instructions. Follow =
them
carefully as a screw up here will render the installation useless.
8. Check again to make sure http://localhost/ brings up the Apache =
default
page. Then make a web page that runs the phpinfo() function. Run it =
and
scroll down. Verify you see the MySQL section.
9. I recommend you download and install the phpMyAdmin program. It is
available at http://www.phpmyadmin.net/home_page/index.php. It is a a =
set
of PHP scripts which does an excellent job of setting up and =
administering
MySQL databases.

Once you have everything working as described, use the books you bought.
They will have a lot of help in how to use the capabilities. =20
P.S. You can use other computers on a home network to view web pages,
including MySQL data by using http://xxx.xxx.xxx.xxx/web_page.php You =
can
find the IP address you need in the client information of
MySQL-Administrator on the server information tab.

Hope you find this helpful.
-----Original Message-----
From: LE Backup [mailto:lucretias@shaw.ca]=20
Sent: Friday, January 06, 2006 15:54
To: lawson@vrtinc.com; 'Don Lancaster'; win32@lists.mysql.com
Subject: RE: PHP and MySQL

Contrary to belief, and the installation documentation (and I know I'll
confuse this poor person so kinda ignore me, but for everyone else...)

You do NOT need to put any of these files in the %windir% or %system%,
matter of a fact our machine build policies will NOT allow any =
NON-Microsoft
product to install ANYTHING in the %windir%, and if it insists, we =
simply
will not use it.

For WAMP setup, we left the libmysql.dll and libmysqli.dll in the =
apache/bin
dir.

Cheers,

James Friesen, CIO

Lucretia Enterprises
"Our World Is Here..."
Info at lucretia dot ca
http://lucretia.ca


> I'm reading up on the integration of MySQL, Apache, and PHP
> in a book called "How to Do Everything with PHP and MySQL" by
> Vikram Vaswani
> (McGraw-Hill/Osborne) which lists several steps to configure
> the connection between Apache and PHP. Since I haven't
> reached the point of doing this yet, I can't say if it works,
> but here are the steps Vikram lists:
>
> 1. Extract the PHP distribution file to c:\php.
> 2. Copy the file php.ini-recommended from c:\php to
> c:\windows as php.ini.
> 3. Copy the file libmysql.dll from c:\php to c:\windows\system32.
> 4. Edit the c:\windows\php.ini file as follows:
> change the string 'extension_dir =3D "./"' to
> 'extension_dir =3D "c"\php\ext"'.
> Delete the ';' from the line ';extension=3Dphp_mysql.dll 5.
> Open the Apache configuration file "httpd.conf" (in the
> Apache/conf/ subdirectory of the Apache installation
> directory) and add the following lines to it:
> AddType application/x-httpd-php .php
> LoadModule php5_module "c:\php\php5apache.dll"
> SetEnv PHPRC C:\windows



--=20
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: =
http://lists.mysql.com/win32?unsub=3DLarry@wakewash.com





--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org