It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

Fatal error

Moderator: Malcolm

Fatal error

Postby cybh on Thu Jun 09, 2005 8:38 am

I have install apache2, mysql4.0 and php 4.0 on my linux server.

When i open my webpage in, the below message will come out

Fatal error: Call to undefined function: mysql_connect()

can anybody help me in this case??? thanks!
cybh
 
Posts: 2
Joined: Thu Jun 09, 2005 8:34 am

Postby webmaster on Thu Jun 09, 2005 11:08 am

Hi and welcome to DEVPPL.

Does all other php functions work?
Do you have a database to connect to?
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby Malcolm on Fri Jun 10, 2005 12:56 pm

Sounds like PHP wasn't compiled with MySQL support. Put:
Code: Select all
<?php phpinfo(); ?>

in a PHP page and check the output for MySQL information to be sure.
Image
User avatar
Malcolm
100+ Club
 
Posts: 198
Joined: Thu Oct 07, 2004 9:53 pm
Location: Ontario, Canada

Postby cybh on Mon Jun 20, 2005 12:58 am

Thanks for your reply.
PHP and MYSQL are working, but PHP seems fail to connect to mysql. All other php functions are working too.I cant find mysql package in the phpinfo page.
cybh
 
Posts: 2
Joined: Thu Jun 09, 2005 8:34 am

Postby Malcolm on Mon Jun 20, 2005 5:06 am

Well if you don't see something along the lines of:
Code: Select all
mysql
MySQL Support   enabled
Active Persistent Links    0
Active Links    0
Client API version    4.0.24
MYSQL_MODULE_TYPE    external
MYSQL_SOCKET    /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE    -I/usr/include/mysql
MYSQL_LIBS    -L/usr/lib -lmysqlclient

Directive   Local Value   Master Value
mysql.allow_persistent   On   On
mysql.connect_timeout   60   60
mysql.default_host   no value   no value
mysql.default_password   no value   no value
mysql.default_port   no value   no value
mysql.default_socket   no value   no value
mysql.default_user   no value   no value
mysql.max_links   Unlimited   Unlimited
mysql.max_persistent   Unlimited   Unlimited
mysql.trace_mode   Off   Off


Then you probably don't have MySQL support compiled into your PHP install
Image
User avatar
Malcolm
100+ Club
 
Posts: 198
Joined: Thu Oct 07, 2004 9:53 pm
Location: Ontario, Canada


Who is online

Users browsing this forum: No registered users and 0 guests