Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] "Called to undefined function" - problem with php
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kbzium
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2012
Posts: 146

PostPosted: Mon Aug 06, 2012 8:26 pm    Post subject: [Solved] "Called to undefined function" - problem Reply with quote

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?
Code:
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
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Mon Aug 06, 2012 10:06 pm    Post subject: Reply with quote

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.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
kbzium
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2012
Posts: 146

PostPosted: Tue Aug 07, 2012 6:07 am    Post subject: Reply with quote

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

Thank you!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue Aug 07, 2012 7:41 am    Post subject: Reply with quote

You're welcome :) . Don't forget to either update your make.conf to include the mysql flag or add this line:
/etc/portage/package.use:
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.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum