Fatal error: Call to undefined function: mysql_connect()

khoonchee

Well-Known Member
PartnerNOC
Oct 2, 2002
134
0
166
Hi,

I have setup a cron job in Cpanel which will send the output to my email but the output returns the following in the email :

Fatal error: Call to undefined function: mysql_connect() in /home/user/public_html/database.php on line 4

The command which I used in Cpanel is :

php -f /home/user/public_html/digest.php

Below is the line in database.php on line 4 :

$db = mysql_connect("localhost", "user_db", "password");

When I execute the command directly in shell or run the script directly from the web browser, there is no error return.

Am I missing something on the server part?

Thanks,

cPanel.net Support Ticket Number:
 

khoonchee

Well-Known Member
PartnerNOC
Oct 2, 2002
134
0
166
Hi,

Does any one have guides about this?

I have tried recompile the php with the '--with-mysql=/usr' but getting the error message when I run the make command :

/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14.
ext/mysql/php_mysql.lo: In function `zif_mysql_create_db':
/exa/php-4.3.2/ext/mysql/php_mysql.c:1115: undefined reference to `mysql_create_db'
ext/mysql/php_mysql.lo: In function `zif_mysql_drop_db':
/exa/php-4.3.2/ext/mysql/php_mysql.c:1157: undefined reference to `mysql_drop_db'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Thanks,

cPanel.net Support Ticket Number:
 

khoonchee

Well-Known Member
PartnerNOC
Oct 2, 2002
134
0
166
Hi,

anyone ?:confused:

cPanel.net Support Ticket Number:
 

khoonchee

Well-Known Member
PartnerNOC
Oct 2, 2002
134
0
166
ok...

recompiled the apache with php and fixed the problem....:p

cPanel.net Support Ticket Number: