Page 1 of 1

php isn't seeing mysql at installation

Posted: Mon Nov 03, 2003 6:07 pm
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..

Posted: Thu Nov 06, 2003 12:26 am
by BDKR
When you first installed Red Hat, was PHP allready working?

Posted: Thu Nov 06, 2003 12:30 am
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