Portal Home > Knowledgebase > Articles Database > Call to undefined function mysql_connect()


Call to undefined function mysql_connect()




Posted by nashenas, 10-08-2009, 04:22 PM
Hello , We installed kloxo in a vps machine and get error in our php script : Here is my phpinfo : http://204.124.181.182/info.php Please advise us why does apache configure with below options !! :

Posted by root24x7, 10-08-2009, 04:46 PM
Your php doesn't include mysql module. try install it using yum

Posted by nashenas, 10-08-2009, 04:50 PM
Thank you for your response Here is result :

Posted by RBBOT, 10-08-2009, 05:01 PM
Have you installed a software package that has installed a 2nd copy of php in additional to the one installed by the yum system? Try: find / -name php -xtype f

Posted by nashenas, 10-08-2009, 05:07 PM
We only install kloxo . Here is result of your command : find / -name php -xtype f /usr/local/bin/php /usr/local/lxlabs/ext/php/bin/php /usr/local/lxlabs/ext/php/php /usr/bin/php

Posted by tim2718281, 10-08-2009, 05:30 PM
I think that means your PHP code has been built with the 'without-mysql' option. Why that would be, I do not know. If I'm right, you need to use a copy of PHP that has been built with the mysql option; something like: ./configure --with-mysql=/usr/local/mysql make make install cp php.ini-dist /usr/local/lib/php.ini :

Posted by nashenas, 10-08-2009, 05:34 PM
I think that means your PHP code has been built with the 'without-mysql' option. == > yes ! If I'm right, you need to use a copy of PHP that has been built with the mysql option = > how ? Where can I find copy of PHP that has been built with the mysql option ?

Posted by tim2718281, 10-08-2009, 05:41 PM
Well, if you don't know how to deal with the "simple" Linux maintenance environments - which I personally find amazingly confusing, maybe because there are a range of methods, none of which I have ever learned properly - the simplest way is to build it yourself from the source ... There are instructions here: http://lamphowto.com/ But I expect someone here can give you other advice, which you may prefer.

Posted by RBBOT, 10-08-2009, 06:09 PM
It does indeed look like you have multiple installations of php. The one in /usr/bin/php is the one that is being updated with mysql support. I suspect your product is built by lxlabs and they are using the one in their own bin folder. You can run "php -i" from the command line to check the info for each of these to see which one(s) have mysql support and which don't.

Posted by nashenas, 10-08-2009, 06:21 PM
Yes . You right ! how can I remove the php which doesn't mysql support ? php -i phpinfo() PHP Version => 5.2.6 System => Linux s02.parsigoo.ir 2.6.18-128.2.1.el5xen #1 SMP Tue Jul 14 07:07:49 EDT 2009 x86_64 Build Date => May 26 2009 22:30:38 Configure Command => './configure' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '-- target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin ' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/u sr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/sha re/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-fil e-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--w ithout-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-d ir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettex t' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic- quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' ' --enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixOD BC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-system-tzdata' '--e nable-force-cgi-redirect' '--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-mbstring=shared ' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-ncurses=shared' '--with-gd=shared' '--enable-bcmath =shared' '--enable-dba=shared' '--with-db4=/usr' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-s asl' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--enable-dom=shared' '--with- dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--enable-soap=share d' '--with-xsl=shared,/usr' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--enable-fastcgi' '--e nable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=s hared,/usr' '--with-pdo-sqlite=shared,/usr' '--enable-json=shared' '--enable-zip=shared' '--with-readline'

Posted by root24x7, 10-09-2009, 06:50 PM
Hope this url may help you http://forum.lxcenter.org/index.php?t=msg&goto=71307&

Posted by nashenas, 10-10-2009, 04:45 PM
It resolved by this solution : Thank you for your help .



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Zeus Botnet? (Views: 759)


Language:

LoadingRetrieving latest tweet...

Back to Top Copyright © 2018 DC International LLC. - All Rights Reserved.