php isn't seeing mysql at installation

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
robin1
Forum Newbie
Posts: 20
Joined: Thu Aug 01, 2002 4:36 pm

php isn't seeing mysql at installation

Post by robin1 »

Hello everybody.

My research shows it to be a common problem but most of the posting don’t have the end results or it goes on and on and on to never never land.

I get the following message accessing MYSQL database with PHP:
Fatal error: Call to undefined function: mysql_connect() in /var/www/html/test2/index.php on line 16
What I have: redhat9, php4, mysql and no firewall setup on linux box.
Independently both php and mysql works fine.

Has anyone recently experienced this that we can talk about. weeks worth of research and fixs hasn’t worked. But from what I can see it has something to do with the path or php doesn’t see where mysql is located at \\wwwroot\mysql..

There has to be an easer way to fix this without reinstalling everything over again.
The structure of apache,php, and mydql
/wwwroot/apache
/wwwroot/php
/wwwroot/mysql

part of the <?info();?>
kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '—enable

tried recompiling... the configuration ran through fine but when i ran the "make" it failed...copy/pasting the part where it failed..

-ldl -lnsl -lcrypt -lcrypt -o sapi/cli/php
ext/mysql/php_mysql.lo(.text+0x22dc): In function `zif_mysql_create_db':
/downloads/php-4.3.3/ext/mysql/php_mysql.c:1160: undefined reference to `mysql_create_db'
ext/mysql/php_mysql.lo(.text+0x2513): In function `zif_mysql_drop_db':
/downloads/php-4.3.3/ext/mysql/php_mysql.c:1202: undefined reference to `mysql_drop_db'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
[root@localhost php-4.3.3]#

this is the config file that i ran:
./configure --prefix=/wwwroot/php --with-apxs2=/wwwroot/bin/apxs --with-config-file-path=/wwwroot/php --with-mysql=/wwwroot/mysql
but failed when i ran the make command...

any help u can give me would be greatly appreciated..
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

When you first installed Red Hat, was PHP allready working?
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

I really should go on. The reason PHP isn't "seeing" mysql is because the mysql functions have not been compiled in. If it you get an undefined function message, that function just simple doesn't exist.

I have an idea of what may be going on but I need to know the answer to the question in the last post.

Cheers,
BDKR
Post Reply