Totally lost! "Fatal error: Call to undefined function: mysql_connect()"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • awdsites@gmail.com

    Totally lost! "Fatal error: Call to undefined function: mysql_connect()"

    Hi,

    I'm a noob with a server so keep that in mind :) Been trying to connect
    with php to mysql and all I get is:

    "Fatal error: Call to undefined function: mysql_connect() "

    I've read and read and can't figure out what is wrong. My current set
    up is:

    # rpm -qa | grep php

    php-ldap-4.3.2-23.ent
    php-mysql-4.3.2-3mdk
    php-imap-4.3.2-23.ent
    php-4.3.2-23.ent

    # rpm -qa | grep php

    php-ldap-4.3.2-23.ent
    php-mysql-4.3.2-3mdk
    php-imap-4.3.2-23.ent
    php-4.3.2-23.ent

    On RedHat 3.2ES

    Can someone please help? I've been trying for 2 weeks now and I still
    don't know what to do. TIA!

  • Steve

    #2
    Re: Totally lost! "Fatal error: Call to undefined function: mysql_connect() "

    Is this from the command line, or from a browser-driven app? If the
    former, this is usual, as MySQL ab are doing stupid things with licensing.

    If you wand mysql support from the command line, you'll have to roll your
    own.

    Steve

    On Sun, 15 Jan 2006 09:01:12 -0800, awdsites wrote:
    [color=blue]
    > Hi,
    >
    > I'm a noob with a server so keep that in mind :) Been trying to connect
    > with php to mysql and all I get is:
    >
    > "Fatal error: Call to undefined function: mysql_connect() "
    >
    > I've read and read and can't figure out what is wrong. My current set
    > up is:
    >
    > # rpm -qa | grep php
    >
    > php-ldap-4.3.2-23.ent
    > php-mysql-4.3.2-3mdk
    > php-imap-4.3.2-23.ent
    > php-4.3.2-23.ent
    >
    > # rpm -qa | grep php
    >
    > php-ldap-4.3.2-23.ent
    > php-mysql-4.3.2-3mdk
    > php-imap-4.3.2-23.ent
    > php-4.3.2-23.ent
    >
    > On RedHat 3.2ES
    >
    > Can someone please help? I've been trying for 2 weeks now and I still
    > don't know what to do. TIA![/color]

    Comment

    • nicewilly

      #3
      Re: Totally lost! "Fatal error: Call to undefined function: mysql_connect() "

      thanks steve, but I need specifics to get this thing going.
      [color=blue]
      > Is this from the command line, or from a browser-driven app?[/color]

      not sure what you mean there, but mysql is on my server that I use
      webmin to administer, but I'll happily go command line if that will get
      things working

      Comment

      • Littlefire

        #4
        Re: Totally lost! "Fatal error: Call to undefined function: mysql_connect() "

        awdsites@gmail. com wrote:
        [color=blue]
        > Hi,
        >
        > I'm a noob with a server so keep that in mind :) Been trying to connect
        > with php to mysql and all I get is:
        >
        > "Fatal error: Call to undefined function: mysql_connect() "[/color]
        ==snip==[color=blue]
        > # rpm -qa | grep php
        >
        > php-ldap-4.3.2-23.ent
        > php-mysql-4.3.2-3mdk
        > php-imap-4.3.2-23.ent
        > php-4.3.2-23.ent[/color]

        I haven't worked with PHP4 in quite a while, but I seem to remember that you
        have to enable the mysql.so extension in your php.ini file. On PHP5 that
        isn't necessary any more.
        $ locate php.ini
        /etc/php/apache2-php5/php.ini
        ^^^ This will be different for you.
        --- The mysql.so extension should be listed in the file, you just uncomment
        it.
        $ grep mysql.so /etc/php/apache2-php5/php.ini
        --- Now use a text editor to open that file and uncomment the correct
        line(s)
        --- Then you restart your apache
        $ su
        Password:
        # apachectl restart

        That should have you fixed up :)

        Albe

        Comment

        • nicewilly

          #5
          Re: Totally lost! "Fatal error: Call to undefined function: mysql_connect() "

          thanks, tried that and still no luck. still getting the fatal error...

          Comment

          • nicewilly

            #6
            Re: Totally lost! "Fatal error: Call to undefined function: mysql_connect() "

            I've just been told it is because I need to change this:

            '--with-mysql=shared,/usr'

            to this:

            '--with-mysql=/var/lib'

            does that seem correct? if so, how the heck do I do that *exactly*
            without screwing up all the other php settings?

            Comment

            Working...