Re: Connect to MySQL via PHP with success!
Hello MySQL email listers, Success at last. The tips i received from the MySQL list, got me on track. Finally got the PHP and MySQL set up correctly, thanks to the help from this list. Thanks Again, Eric [EMAIL PROTECTED] wrote: On 11-Feb-2004 Eric W. Holzapfel wrote: Hello Listers, I have a problem with my PHP/redhat setup, and possible problem with my Mysql setup. I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES system. Apache 2.0 + PHP is a known buggy combination. I have MySql installed on a Slackware linux box. Server on a remote host? Gotcha. I want to be able to use Apache/PHP to connect to the mysql database on the slackware box. I "think" that PHP is set up ok, which may be a lie, because PHP says it does not recognize the commands like - mysql_pconnect and mysql_connect. No, wait, lemme guess. Like 'function not defined' ? (eat your heart out, Miss Cleo) Also if I try to connect to the database using something like this: mysql://user,[EMAIL PROTECTED] demodb this fails and the "or die getMessage()" returns DB: no such database. (I am trying to use the Pear DB here) Do I need to have mysql installed on the red hat machine? You'll need to compile in the client libs at least. I can connect to the slackware linux box from a Windows machine using ODBC. So your server is working and accepting remote connections. This is a good thing! Any ideas on what I have not done, or what I have done wrong? You haven't configured the Redhat PHP install to build in the MySQL client libraries. To verify this --try this script: --- --- Look for '--with-mysql' in the Configure Command section. Also look for a MySQL Support section. Regards,
RE: Connect to MySQL via PHP
I'm using apache 2, and I'm not having any problems with it at all. It's a little weird trying to get it configured the first time, but other than that it's not bad. We have found that it can push a little more bandwidth and the load seems to be a little lower than 1.x. But then again we are running linux 2.6.x as well. So it could be a combination of things. I was just being lazy when I installed it with apt-get install httpd. So much easier than actually compiling anything! One more added features, if you have the problem with the max clients of 1024 issue, you don't have to worry about that with apache2, you can just add it to the httpd.conf. Donny > -Original Message- > From: Mike Miller [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 12, 2004 12:19 PM > To: [EMAIL PROTECTED] > Subject: Re: Connect to MySQL via PHP > > > The _only_ real benefit of Apache2 over Apache1 is it's thread-based > model. > So why leave a stable, tried-and-true, robust Apache1 platform for no > additional benefits at all? Why break compatibility? Why use the Apache2 > branch if you don't need it? > > PHP itself works quite fine in a threaded mode. However, PHP uses an > enormous number of libraries (GD, database libs, and many others) which > may-or-may-not-be thread-safe. So these libraries can cause some serious > problems... and when you're in a threaded model, programs doing funny > things > is not only difficult to track down, but also can cause serious issues > with > all of the other threads (due to shared process context on the system and > shared memory). > > Lesson- just avoid it for the time being. Save a headache and additional > security patches. > -M > > > >From: Adam Goldstein <[EMAIL PROTECTED]> > >To: mysql <[EMAIL PROTECTED]> > >CC: Don Read <[EMAIL PROTECTED]>,Eric W.Holzapfel <[EMAIL PROTECTED]> > >Subject: Re: Connect to MySQL via PHP > >Date: Thu, 12 Feb 2004 13:05:00 -0500 > > > >Apache2 and php is a buggy combination? Not that I have seen. > > > >Or are you referring to trying to use the Apache Worker (mutlithreaded) > MPM > >with php... I believe that is still a bit buggy, though, no rpms or > >packages seem to install it that way anyways. I'm hoping to get workerMPM > >working for me, too, as I have been having to use thttpd for serving > images > >recently. > > > >I'm not sure how horked up RHES3 is, but, std. RH7-9, Mandrake 7.2-9.2, > >Debian 3+ (among others) seem to have no problem what so ever connecting > >php->mysql out of the box, provided you have a user account on mysql to > >connect to and supply it in your my.cnf, php.ini or mysql_connect > >statements. > > > >keep in mind rh and mdk broke up the portions of php into separate > >packages... such as php-imap, php-mysql, php-cli, php-ldap, etc. You will > >need to install the php-mysql package if mysql_connect is not being > >recognized. Also note, mdk has further separated the php.ini file to use > >separate php include files, similar to how they broke up apache's module > >configs... the structure is /etc/php.ini and > >/etc/php/#_phpmodulename.ini..they load in order of their number... This > is > >good to keep in mind, as the mysql settings are no longer included in the > >primary php.ini file but in 34_mysql.ini. > > > >-- > >Adam Goldstein > >White Wolf Networks > >http://whitewlf.net > > > > > >On Feb 10, 2004, at 10:34 PM, Don Read wrote: > > > >> > >>On 11-Feb-2004 Eric W. Holzapfel wrote: > >>>Hello Listers, > >>> > >>>I have a problem with my PHP/redhat setup, and possible problem with > >>>my > >>>Mysql setup. > >>>I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES > >>>system. > >> > >>Apache 2.0 + PHP is a known buggy combination. > >> > >>>I have MySql installed on a Slackware linux box. > >> > >>Server on a remote host? Gotcha. > >> > >>>I want to be able to use Apache/PHP to connect to the mysql database > >>>on > >>>the slackware box. > >>>I "think" that PHP is set up ok, which may be a lie, because PHP > >>>says > >>>it does not recognize the commands like - mysql_pconnect and > >>>mysql_connect. > >>> > >> > >>No, wait, lemme guess. Like 'function not defined' ? > >> (eat your heart out, Miss Cleo) > >> > >>>Also if I try to connect to the databa
Re: Connect to MySQL via PHP
The _only_ real benefit of Apache2 over Apache1 is it's thread-based model. So why leave a stable, tried-and-true, robust Apache1 platform for no additional benefits at all? Why break compatibility? Why use the Apache2 branch if you don't need it? PHP itself works quite fine in a threaded mode. However, PHP uses an enormous number of libraries (GD, database libs, and many others) which may-or-may-not-be thread-safe. So these libraries can cause some serious problems... and when you're in a threaded model, programs doing funny things is not only difficult to track down, but also can cause serious issues with all of the other threads (due to shared process context on the system and shared memory). Lesson- just avoid it for the time being. Save a headache and additional security patches. -M From: Adam Goldstein <[EMAIL PROTECTED]> To: mysql <[EMAIL PROTECTED]> CC: Don Read <[EMAIL PROTECTED]>,Eric W.Holzapfel <[EMAIL PROTECTED]> Subject: Re: Connect to MySQL via PHP Date: Thu, 12 Feb 2004 13:05:00 -0500 Apache2 and php is a buggy combination? Not that I have seen. Or are you referring to trying to use the Apache Worker (mutlithreaded) MPM with php... I believe that is still a bit buggy, though, no rpms or packages seem to install it that way anyways. I'm hoping to get workerMPM working for me, too, as I have been having to use thttpd for serving images recently. I'm not sure how horked up RHES3 is, but, std. RH7-9, Mandrake 7.2-9.2, Debian 3+ (among others) seem to have no problem what so ever connecting php->mysql out of the box, provided you have a user account on mysql to connect to and supply it in your my.cnf, php.ini or mysql_connect statements. keep in mind rh and mdk broke up the portions of php into separate packages... such as php-imap, php-mysql, php-cli, php-ldap, etc. You will need to install the php-mysql package if mysql_connect is not being recognized. Also note, mdk has further separated the php.ini file to use separate php include files, similar to how they broke up apache's module configs... the structure is /etc/php.ini and /etc/php/#_phpmodulename.ini..they load in order of their number... This is good to keep in mind, as the mysql settings are no longer included in the primary php.ini file but in 34_mysql.ini. -- Adam Goldstein White Wolf Networks http://whitewlf.net On Feb 10, 2004, at 10:34 PM, Don Read wrote: On 11-Feb-2004 Eric W. Holzapfel wrote: Hello Listers, I have a problem with my PHP/redhat setup, and possible problem with my Mysql setup. I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES system. Apache 2.0 + PHP is a known buggy combination. I have MySql installed on a Slackware linux box. Server on a remote host? Gotcha. I want to be able to use Apache/PHP to connect to the mysql database on the slackware box. I "think" that PHP is set up ok, which may be a lie, because PHP says it does not recognize the commands like - mysql_pconnect and mysql_connect. No, wait, lemme guess. Like 'function not defined' ? (eat your heart out, Miss Cleo) Also if I try to connect to the database using something like this: mysql://user,[EMAIL PROTECTED] demodb this fails and the "or die getMessage()" returns DB: no such database. (I am trying to use the Pear DB here) Do I need to have mysql installed on the red hat machine? You'll need to compile in the client libs at least. I can connect to the slackware linux box from a Windows machine using ODBC. So your server is working and accepting remote connections. This is a good thing! Any ideas on what I have not done, or what I have done wrong? You haven't configured the Redhat PHP install to build in the MySQL client libraries. To verify this --try this script: --- --- Look for '--with-mysql' in the Configure Command section. Also look for a MySQL Support section. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going tosteal the neighbor's newspaper, that's the time to do it. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Connect to MySQL via PHP
Apache2 and php is a buggy combination? Not that I have seen. Or are you referring to trying to use the Apache Worker (mutlithreaded) MPM with php... I believe that is still a bit buggy, though, no rpms or packages seem to install it that way anyways. I'm hoping to get workerMPM working for me, too, as I have been having to use thttpd for serving images recently. I'm not sure how horked up RHES3 is, but, std. RH7-9, Mandrake 7.2-9.2, Debian 3+ (among others) seem to have no problem what so ever connecting php->mysql out of the box, provided you have a user account on mysql to connect to and supply it in your my.cnf, php.ini or mysql_connect statements. keep in mind rh and mdk broke up the portions of php into separate packages... such as php-imap, php-mysql, php-cli, php-ldap, etc. You will need to install the php-mysql package if mysql_connect is not being recognized. Also note, mdk has further separated the php.ini file to use separate php include files, similar to how they broke up apache's module configs... the structure is /etc/php.ini and /etc/php/#_phpmodulename.ini..they load in order of their number... This is good to keep in mind, as the mysql settings are no longer included in the primary php.ini file but in 34_mysql.ini. -- Adam Goldstein White Wolf Networks http://whitewlf.net On Feb 10, 2004, at 10:34 PM, Don Read wrote: On 11-Feb-2004 Eric W. Holzapfel wrote: Hello Listers, I have a problem with my PHP/redhat setup, and possible problem with my Mysql setup. I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES system. Apache 2.0 + PHP is a known buggy combination. I have MySql installed on a Slackware linux box. Server on a remote host? Gotcha. I want to be able to use Apache/PHP to connect to the mysql database on the slackware box. I "think" that PHP is set up ok, which may be a lie, because PHP says it does not recognize the commands like - mysql_pconnect and mysql_connect. No, wait, lemme guess. Like 'function not defined' ? (eat your heart out, Miss Cleo) Also if I try to connect to the database using something like this: mysql://user,[EMAIL PROTECTED] demodb this fails and the "or die getMessage()" returns DB: no such database. (I am trying to use the Pear DB here) Do I need to have mysql installed on the red hat machine? You'll need to compile in the client libs at least. I can connect to the slackware linux box from a Windows machine using ODBC. So your server is working and accepting remote connections. This is a good thing! Any ideas on what I have not done, or what I have done wrong? You haven't configured the Redhat PHP install to build in the MySQL client libraries. To verify this --try this script: --- --- Look for '--with-mysql' in the Configure Command section. Also look for a MySQL Support section. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Connect to MySQL via PHP
Did you install PHP-mysql*.rpm? Curtis On Tue, 10 Feb 2004, Eric W. Holzapfel wrote: > Hello Listers, > > I have a problem with my PHP/redhat setup, and possible problem with my > Mysql setup. > I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES system. > I have MySql installed on a Slackware linux box. > > I want to be able to use Apache/PHP to connect to the mysql database on > the slackware box. > I "think" that PHP is set up ok, which may be a lie, because PHP says > it does not recognize the commands like - mysql_pconnect and mysql_connect. > > Also if I try to connect to the database using something like this: > mysql://user,[EMAIL PROTECTED] demodb this fails and the "or die > getMessage()" returns > DB: no such database. (I am trying to use the Pear DB here) > > Do I need to have mysql installed on the red hat machine? > I can connect to the slackware linux box from a Windows machine using ODBC. > > Any ideas on what I have not done, or what I have done wrong? > > eric > > > > > -- -- Curtis Maurand mailto:[EMAIL PROTECTED] http://www.maurand.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Connect to MySQL via PHP
On 11-Feb-2004 Eric W. Holzapfel wrote: > Hello Listers, > > I have a problem with my PHP/redhat setup, and possible problem with > my > Mysql setup. > I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES > system. Apache 2.0 + PHP is a known buggy combination. > I have MySql installed on a Slackware linux box. Server on a remote host? Gotcha. > I want to be able to use Apache/PHP to connect to the mysql database > on > the slackware box. > I "think" that PHP is set up ok, which may be a lie, because PHP > says > it does not recognize the commands like - mysql_pconnect and > mysql_connect. > No, wait, lemme guess. Like 'function not defined' ? (eat your heart out, Miss Cleo) > Also if I try to connect to the database using something like this: > mysql://user,[EMAIL PROTECTED] demodb this fails and the "or die > getMessage()" returns > DB: no such database. (I am trying to use the Pear DB here) > > Do I need to have mysql installed on the red hat machine? You'll need to compile in the client libs at least. > I can connect to the slackware linux box from a Windows machine using > ODBC. > So your server is working and accepting remote connections. This is a good thing! > Any ideas on what I have not done, or what I have done wrong? > You haven't configured the Redhat PHP install to build in the MySQL client libraries. To verify this --try this script: --- --- Look for '--with-mysql' in the Configure Command section. Also look for a MySQL Support section. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Connect to MySQL via PHP
* First check if Mysql is supported by PHP Create a file test.php with When opening it on your web server, look for a Mysql section (should have a Mysql Section in the PHP configuration) * If you don't have the Mysql support, you need to recompile PHP with Mysql: (INSTALL file) $ cd php-4.x.y $ ./configure --with-mysql --with-apxs $ make $ make install * check php.ini ;; ; Dynamic Extensions ; ;; (...) ;Linux world ; extension=mysql.so Hope this will help. If you need more details, not feel free to contact. Kind regards, Franck ZAIRE Tested on Config: RH 9 - PHP 4.3 - Mysql 4.0 -Original Message- From: Ligaya Turmelle [mailto:[EMAIL PROTECTED] Sent: 11 February 2004 02:14 To: Eric W. Holzapfel; [EMAIL PROTECTED] Subject: RE: Connect to MySQL via PHP I have never done this but... Go to your php.ini file and see if changing the [MySQL] mysql.default_host = is set to the database. Respectfully, Ligaya Turmelle -Original Message- From: Eric W. Holzapfel [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 12:00 PM To: [EMAIL PROTECTED] Subject: Connect to MySQL via PHP Hello Listers, I have a problem with my PHP/redhat setup, and possible problem with my Mysql setup. I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES system. I have MySql installed on a Slackware linux box. I want to be able to use Apache/PHP to connect to the mysql database on the slackware box. I "think" that PHP is set up ok, which may be a lie, because PHP says it does not recognize the commands like - mysql_pconnect and mysql_connect. Also if I try to connect to the database using something like this: mysql://user,[EMAIL PROTECTED] demodb this fails and the "or die getMessage()" returns DB: no such database. (I am trying to use the Pear DB here) Do I need to have mysql installed on the red hat machine? I can connect to the slackware linux box from a Windows machine using ODBC. Any ideas on what I have not done, or what I have done wrong? eric -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Connect to MySQL via PHP
I have never done this but... Go to your php.ini file and see if changing the [MySQL] mysql.default_host = is set to the database. Respectfully, Ligaya Turmelle -Original Message- From: Eric W. Holzapfel [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 12:00 PM To: [EMAIL PROTECTED] Subject: Connect to MySQL via PHP Hello Listers, I have a problem with my PHP/redhat setup, and possible problem with my Mysql setup. I have Apache (2.0) and PHP (4.3.2) installed on a Red Hat 3.0 ES system. I have MySql installed on a Slackware linux box. I want to be able to use Apache/PHP to connect to the mysql database on the slackware box. I "think" that PHP is set up ok, which may be a lie, because PHP says it does not recognize the commands like - mysql_pconnect and mysql_connect. Also if I try to connect to the database using something like this: mysql://user,[EMAIL PROTECTED] demodb this fails and the "or die getMessage()" returns DB: no such database. (I am trying to use the Pear DB here) Do I need to have mysql installed on the red hat machine? I can connect to the slackware linux box from a Windows machine using ODBC. Any ideas on what I have not done, or what I have done wrong? eric -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]