# [Solved] "Called to undefined function" - problem with php

## kbzium

Hello,

I get these kind of errors anytime I launch my scripts:

Fatal error: Call to undefined function mysql_connect() 

Is there something wrong with my PHP configuration or it's something with database or else?

```
Configure Command    './configure' '--prefix=/usr' '--build=x86_64-pc-linux-gnu' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--prefix=/usr/lib64/php5.3' '--mandir=/usr/lib64/php5.3/man' '--infodir=/usr/lib64/php5.3/info' '--libdir=/usr/lib64/php5.3/lib' '--with-libdir=lib64' '--without-pear' '--disable-maintainer-zts' '--disable-bcmath' '--with-bz2' '--disable-calendar' '--enable-ctype' '--without-curl' '--without-curlwrappers' '--enable-dom' '--without-enchant' '--enable-exif' '--enable-fileinfo' '--enable-filter' '--disable-ftp' '--with-gettext' '--without-gmp' '--enable-hash' '--without-mhash' '--with-iconv' '--disable-intl' '--enable-ipv6' '--enable-json' '--without-kerberos' '--enable-libxml' '--enable-mbstring' '--with-mcrypt' '--without-mssql' '--with-onig=/usr' '--with-openssl' '--with-openssl-dir=/usr' '--disable-pcntl' '--enable-phar' '--disable-pdo' '--without-pgsql' '--enable-posix' '--with-pspell' '--without-recode' '--enable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap' '--disable-sockets' '--without-sqlite' '--without-sqlite3' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--without-tidy' '--enable-tokenizer' '--disable-wddx' '--enable-xml' '--disable-xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--without-xsl' '--disable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--disable-flatfile' '--with-gdbm' '--disable-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir' '--with-gd' '--with-ldap' '--without-ldap-sasl' '--with-mysqli=/usr/bin/mysql_config' '--with-readline' '--without-libedit' '--without-mm' '--with-pcre-regex=/usr' '--with-pcre-dir=/usr' '--with-config-file-path=/etc/php/apache2-php5.3' '--with-config-file-scan-dir=/etc/php/apache2-php5.3/ext-active' '--disable-embed' '--disable-cli' '--disable-cgi' '--disable-fpm' '--with-apxs2=/usr/sbin/apxs' 
```

Moreover, mysqli is present in phpinfo().

Any suggestions? Thanks!Last edited by kbzium on Tue Aug 07, 2012 6:07 am; edited 1 time in total

----------

## VinzC

You only have mysqli USE flag enabled. Run USE=mysql emerge -avq php. Having mysqli is not the same as mysql, these are distinct USE flags and features. Or you can use mysqli_connect() in your scripts instead.

----------

## kbzium

I did just like you told me too. It worked like a charm. 

Thank you!

----------

## VinzC

You're welcome  :Smile:  . Don't forget to either update your make.conf to include the mysql flag or add this line:

```
dev-lang/php       mysql
```

to your /etc/portage/package.use. Just create the file if it doesn't exist yet. See man portage for more information. Without that line php will revert to not using mysql next time you compile it, e.g. through world upgrade.

----------

