Operating Systems > Linux and UNIX

PHP/MySQL problems

(1/4) > >>

Maniaman:
I'm having some problems with my Install of PHP and MySQL.

On a PHP sciprt I made I need it to connect to MySQL.
I keep getting this error:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/register1.php on line 21

Here's Line 21 of that file

mysql_connect("localhost", "root", "*");

*Password Removed

It works on other builds of PHP...

Also, where does MySQL keep all of it's configuration? (Stupid question)

voidmain:
What distro please?  If it's Red Hat you'll need to install the "php-mysql" RPM from your CD. The equivalent of that will need to be installed on any other Linux distro. And of course MySQL has to be installed but I am sure you know that. It would depend on what distro you are using as the where it's configuration files are.

[ December 18, 2002: Message edited by: void main ]

Maniaman:
Distro = Linux Mandrake 9.0

I also have installed the php-mysql rpm

[ December 19, 2002: Message edited by: Maniaman ]

KernelPanic:

quote:Originally posted by Maniaman:
I'm having some problems with my Install of PHP and MySQL.

On a PHP sciprt I made I need it to connect to MySQL.
I keep getting this error:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/register1.php on line 21

Here's Line 21 of that file

mysql_connect("localhost", "root", "*");

*Password Removed

It works on other builds of PHP...

Also, where does MySQL keep all of it's configuration? (Stupid question)
--- End quote ---


Haa it connected before on another page, have you made a simple sql connection test?

voidmain:
And you have MySQL and MySQL-client RPMs installed? And the MySQL server is up and running? And you have php and php-common RPMs installed?

I don't have Mandrake 9.0, this stuff just works when installed on Red Hat. I haven't found anything on the web to indicate it should be any harder than this on Mandrake. Sorry if I haven't been much help.

P.S. You never would want to use "root" and root's real Linux password in a PHP script.

P.S.S. I notice Mandrake breaks out Apache into more RPMS. I don't know if these are needed but other RPMs you might want to make sure are installed are:

apache-common
apache-conf
apache-modules

[ December 19, 2002: Message edited by: void main ]

Navigation

[0] Message Index

[#] Next page

Go to full version