Please help with PHP and mysql_connect Fatal error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
smonsivaes
Forum Newbie
Posts: 1
Joined: Mon Oct 21, 2002 11:27 pm

Please help with PHP and mysql_connect Fatal error

Post by smonsivaes »

Fatal error: Call to undefined function: mysql_connect() in /var/www/html/php/mysqlconnect.php on line 2
...this is the problem i am having.
RedHat 8.0
Running Apache 2.0.40
compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
MySQL 3.23.52
PHP 4.2.2 installed as a DSO module
and includes --with-mysql=shared,/usr' '
(note that i do not know if this --with-mysql statement is correct..my libmysqlclient.so is in /usr/lib/mysql ...? is this correct? )

i installed PHP as an RPM since im a newbie in compiling and installing.
note: i am able to run PHP scripts on the web server and it does parse the code correctly but my problem is when i try to connect to mysql using a simple script like so to test the connection.
<?php
$conn = mysql_connect("localhost", "user", "pass");
echo "$conn";
?>

any help or point in the right direction is very much appreciated!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

probably there is another package in your distribution for the mysql/php-plugin.
afaik redhat uses names like php-mysql-<version>.<architecture>.rpm for packages
Post Reply