# [SOLVED] Call to undefined function: mysql_connect()

## rndguy

I have successfully emerged apache2, mysql, and php4 on my Gentoo PPC system (KuroBox). HTML based web pages are served up fine, however, I am having a problem with getting PHP and mysql to play well with each other. I get the following information from PHPinfo:

```

PHP Version 4.4.4-pl4-gentoo

System   Linux TunaCan 2.4.17_mvl21 #24 2004Ç¯ 10·î 19Æü ²ÐÍËÆü 17:17:03 JST ppc

Build Date   Oct 7 2006 17:51:32

Configure Command    './configure' '--prefix=/usr/lib/php4' '--host=powerpc-unknown-linux-gnu' '--mandir=/usr/lib/php4/man' '--infodir=/usr/lib/php4/info' '--sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php4' '--with-config-file-scan-dir=/etc/php/apache2-php4/ext-active' '--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar' '--disable-ctype' '--with-curl' '--disable-dbase' '--without-dom' '--disable-exif' '--without-fbsql' '--without-fdftk' '--disable-filepro' '--disable-ftp' '--with-gettext' '--without-gmp' '--without-hwapi' '--without-iconv' '--without-informix' '--without-kerberos' '--enable-mbstring' '--without-mcal' '--with-mcrypt' '--without-mcve' '--disable-memory-limit' '--without-mhash' '--without-ming' '--without-mnogosearch' '--without-msql' '--without-mssql' '--with-ncurses' '--without-oci8' '--without-oci8-instant-client' '--without-oracle' '--with-openssl' '--with-openssl-dir=/usr' '--disable-overload' '--without-ovrimos' '--disable-pcntl' '--without-pfpro' '--without-pgsql' '--disable-posix' '--with-pspell' '--without-recode' '--disable-shmop' '--without-snmp' '--disable-sockets' '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--disable-tokenizer' '--disable-wddx' '--without-xmlrpc' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--without-flatfile' '--with-gdbm' '--without-inifile' '--disable-dbx' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--enable-gd-jis-conv' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir' '--with-gd' '--with-ldap' '--without-mysql' '--with-readline' '--without-libedit' '--disable-xslt' '--without-xslt-sablot' '--without-mm'

Server API   Apache 2.0 Handler

Virtual Directory Support   disabled

Configuration File (php.ini) Path   /etc/php/apache2-php4/php.ini

Scan this dir for additional .ini files   /etc/php/apache2-php4/ext-active

PHP API   20020918

PHP Extension   20020429

Zend Extension   20050606

Debug Build   no

Zend Memory Manager   enabled

Thread Safety   disabled

Registered PHP Streams   php, http, ftp, https, ftps, compress.bzip2, compress.zlib

```

Mysql is running on my system and is accessible through my terminal. I get the following error when I try a PHP-based webpage that is supposed to interact with mysql:

```

Fatal error: Call to undefined function: mysql_connect() in /var/www/localhost/htdocs/adodb/drivers/adodb-mysql.inc.php on line 354

```

Is this an apache2 issue, a mysql issue, or a PHP4 issue? I have searched for a solution but could not find one for my system. Is there a module I need and if so, how to I emerge it? Thanks for your help.Last edited by rndguy on Mon Oct 09, 2006 9:33 pm; edited 1 time in total

----------

## rndguy

It appears a mysql option was not compiled along with php. How can I emerge this functionality?

----------

## kashani

Easiest way is the following

```

cat "dev-lang/php mysql >> /etc/portage/package.use

```

I'd get into the habit is doing emerge -pv <package> so that you can see what it's going to emerge and which USE per package is being turned on.

kashani

----------

