Results 1 to 12 of 12
  1. #1

    * Call to undefined function mysql_connect()

    Hello ,

    We installed kloxo in a vps machine and get error in our php script :

    Code:
    Call to undefined function mysql_connect()


    Here is my phpinfo :
    http://204.124.181.182/info.php

    Please advise us why does apache configure with below options !! :
    Code:
    '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--di

  2. #2
    Your php doesn't include mysql module.

    try install it using yum

    Code:
    yum install php-mysql

  3. #3
    Quote Originally Posted by root24x7 View Post
    Your php doesn't include mysql module.

    try install it using yum

    Code:
    yum install php-mysql

    Thank you for your response

    Here is result :
    Code:
    Package php-mysql-5.2.6-5.x86_64 already installed and latest version

  4. #4
    Join Date
    Dec 2006
    Posts
    477
    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

  5. #5
    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

  6. #6
    Join Date
    Mar 2009
    Posts
    2,218
    Quote Originally Posted by nashenas View Post
    Hello ,

    We installed kloxo in a vps machine and get error in our php script :

    Code:
    Call to undefined function mysql_connect()


    Here is my phpinfo :
    http://204.124.181.182/info.php

    Please advise us why does apache configure with below options !! :
    Code:
    '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--di
    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 :

  7. #7
    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 ?

  8. #8
    Join Date
    Mar 2009
    Posts
    2,218
    Quote Originally Posted by nashenas View Post
    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 ?
    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.

  9. #9
    Join Date
    Dec 2006
    Posts
    477
    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.

  10. #10
    Quote Originally Posted by RBBOT View Post
    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.
    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'

  11. #11

  12. #12
    Quote Originally Posted by root24x7 View Post
    It resolved by this solution :
    after installing Kloxo in Centos64 you must modify extension_dir = /usr/lib/php/modules to extension_dir = /usr/lib64/php/modules in /etc/php.ini

    Thank you for your help .

Similar Threads

  1. Call to undefined function: mysql_connect()
    By andy18 in forum Programming Discussion
    Replies: 15
    Last Post: 08-02-2005, 11:09 PM
  2. Call to undefined function: mysql_connect()
    By superprogram in forum Programming Discussion
    Replies: 15
    Last Post: 04-04-2004, 04:09 AM
  3. Call to undefined function: setfetchmode()
    By nEMESIS4 in forum Dedicated Server
    Replies: 1
    Last Post: 01-17-2004, 07:06 PM
  4. Fatal error: Call to undefined function: mysql_connect()
    By sir_han in forum Hosting Security and Technology
    Replies: 1
    Last Post: 09-15-2003, 07:18 AM
  5. [raq550] Call to undefined function: mysql_connect()
    By freeroad in forum Dedicated Server
    Replies: 3
    Last Post: 10-04-2002, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •