RE: MySQL and PHP4 Not Working Together
Hello Brain, Install the php-mysql pakage from Redhat. Cheers, Pieter -Original Message- From: Brian S. Schang [mailto:[EMAIL PROTECTED]] Sent: 16 February 2002 20:11 To: [EMAIL PROTECTED] Subject: MySQL and PHP4 Not Working Together Hello: I think that I only know about half of what I'm doing here. :-( Anyways, I am running Red Hat 7.2. I have PHP4 running with Apache, and it seems to be working fine. Today, I installed MySQL via the binary RPMs from the Red Hat site. I installed the following: mysql-3.23.41-1.i386.rpm mysql-devel-3.23.41-1.i386.rpm mysql-server-3.23.41-1.i386.rpm mysqlclient9-3.23.22-6.i386.rpm >From the shell, MySQL seems to work fine. :-) At least phpinfo() works. However, when using the mysql_connect() function within PHP4 code, I get the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/phpinfo.php on line 5 This is the contents of the file: (just guessing at what to put here ... just learning) My problem is that I can't get the MySQL commands to work from within a PHP4 script. I'm assuming that the mysql_connect() function (and many others) are in a library somwhere that I'm not referencing in some .conf file?? Or perhaps the "default" binary RPMs from Red Hat are causing me problems?? Lastly, if I remove the MySQL code from the code above, and run only the phpinfo() function, the result tells me that the ./configure command was run with '--without mysql' (from Red Hat). Perhaps this is the problem?? Is there a way that I can add MySQL support by changing a config file, or do I have to recompile PHP4 with '--with mysql'? I'd appreciate any and all help. Thanks. Brian Schang ___ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list
RE: MySQL and PHP4 Not Working Together
Brian: > > Today, I installed MySQL via the binary RPMs from the Red Hat site. I > > installed the following: > > mysql-3.23.41-1.i386.rpm > > mysql-devel-3.23.41-1.i386.rpm > > mysql-server-3.23.41-1.i386.rpm > > mysqlclient9-3.23.22-6.i386.rpm > > > > However, when using the mysql_connect() function within PHP4 code, I get > > the following error: > > Look for the php-mysql package (either from your cd or where you got the > other rpms) and install that. > > RH does not compile the DB support into PHP. They use the > loadable modules > that PHP supports. This gives greater flexibility as to what is > running on > each machine (you can consider it good or bad, but I like the > module thing). > > You may have to add (or uncomment) a line or two in your php.ini > file to make > sure PHP knows to load the module after you install it. I don't > remember if > the rpm does it for you or not. That did the trick! Thank you very much. BTW, the RPM file appears to have installed /usr/lib/php4/mysql.so file. I suspect that this is the module that you referred to?? As far as I can tell, my php.ini file was not modifed by the install. Nonetheless, everything seems to work now. Thanks again for your help. I was quite frustrated... Take care. Brian Schang ___ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list
Re: MySQL and PHP4 Not Working Together
Brian S. Schang, On Saturday 16 February 2002 01:10, you said something about: > Today, I installed MySQL via the binary RPMs from the Red Hat site. I > installed the following: > mysql-3.23.41-1.i386.rpm > mysql-devel-3.23.41-1.i386.rpm > mysql-server-3.23.41-1.i386.rpm > mysqlclient9-3.23.22-6.i386.rpm > > However, when using the mysql_connect() function within PHP4 code, I get > the following error: Look for the php-mysql package (either from your cd or where you got the other rpms) and install that. RH does not compile the DB support into PHP. They use the loadable modules that PHP supports. This gives greater flexibility as to what is running on each machine (you can consider it good or bad, but I like the module thing). You may have to add (or uncomment) a line or two in your php.ini file to make sure PHP knows to load the module after you install it. I don't remember if the rpm does it for you or not. -- Brian Ashe CTO Dee-Web Software Services, LLC. [EMAIL PROTECTED] ___ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list
MySQL and PHP4 Not Working Together
Hello: I think that I only know about half of what I'm doing here. :-( Anyways, I am running Red Hat 7.2. I have PHP4 running with Apache, and it seems to be working fine. Today, I installed MySQL via the binary RPMs from the Red Hat site. I installed the following: mysql-3.23.41-1.i386.rpm mysql-devel-3.23.41-1.i386.rpm mysql-server-3.23.41-1.i386.rpm mysqlclient9-3.23.22-6.i386.rpm >From the shell, MySQL seems to work fine. :-) At least phpinfo() works. However, when using the mysql_connect() function within PHP4 code, I get the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/phpinfo.php on line 5 This is the contents of the file: (just guessing at what to put here ... just learning) My problem is that I can't get the MySQL commands to work from within a PHP4 script. I'm assuming that the mysql_connect() function (and many others) are in a library somwhere that I'm not referencing in some .conf file?? Or perhaps the "default" binary RPMs from Red Hat are causing me problems?? Lastly, if I remove the MySQL code from the code above, and run only the phpinfo() function, the result tells me that the ./configure command was run with '--without mysql' (from Red Hat). Perhaps this is the problem?? Is there a way that I can add MySQL support by changing a config file, or do I have to recompile PHP4 with '--with mysql'? I'd appreciate any and all help. Thanks. Brian Schang ___ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list