PHP not seeing Mysql.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Scribler

    #1

    PHP not seeing Mysql.

    I am trying to use PHPNuke on a linux box but I think PHP does not see
    the Mysql Server.
    When I use the test php program I get this error

    "Fatal error: Call to undefined function: mysql_connect() in
    /home/david/html/html/test.php on line 3"

    I am using Debian unstable. Is there some setting I need to look at in
    the php.ini file?
  • Ian.H

    #2
    Re: PHP not seeing Mysql.

    On Wed, 04 Aug 2004 17:26:56 -0400, David Scribler wrote:
    [color=blue]
    > I am trying to use PHPNuke on a linux box but I think PHP does not see
    > the Mysql Server.
    > When I use the test php program I get this error
    >
    > "Fatal error: Call to undefined function: mysql_connect() in
    > /home/david/html/html/test.php on line 3"
    >
    > I am using Debian unstable. Is there some setting I need to look at in
    > the php.ini file?[/color]


    Did you compile PHP with mysql enabled?



    Regards,

    Ian

    --
    Ian.H
    digiServ Network
    London, UK


    Comment

    • David Scribler

      #3
      Re: PHP not seeing Mysql.

      Ian.H wrote:[color=blue]
      > On Wed, 04 Aug 2004 17:26:56 -0400, David Scribler wrote:
      >
      >[color=green]
      >>I am trying to use PHPNuke on a linux box but I think PHP does not see
      >>the Mysql Server.
      >>When I use the test php program I get this error
      >>
      >>"Fatal error: Call to undefined function: mysql_connect() in
      >>/home/david/html/html/test.php on line 3"
      >>
      >>I am using Debian unstable. Is there some setting I need to look at in
      >>the php.ini file?[/color]
      >
      >
      >
      > Did you compile PHP with mysql enabled?
      >
      >
      >
      > Regards,
      >
      > Ian
      >[/color]
      I did an apt-get on mysql. Since mysql is a default I would asume that
      it was compiled in. I could be wrong.

      Comment

      • Gordon Burditt

        #4
        Re: PHP not seeing Mysql.

        >>>"Fatal error: Call to undefined function: mysql_connect() in[color=blue][color=green][color=darkred]
        >>>/home/david/html/html/test.php on line 3"
        >>>
        >>>I am using Debian unstable. Is there some setting I need to look at in
        >>>the php.ini file?[/color]
        >>
        >>
        >>
        >> Did you compile PHP with mysql enabled?
        >>
        >> Regards,
        >>
        >> Ian
        >>[/color]
        >I did an apt-get on mysql. Since mysql is a default I would asume that
        >it was compiled in. I could be wrong.[/color]

        "Did you compile *PHP* with mysql enabled?"
        is a very different question from
        "Did you install MySQL? (client)"

        If you compiled PHP *before* installing MySQL, chances are it
        won't have the support for MySQL. Even if you compiled it
        *after* installing MySQL, MySQL support may not be the default.

        Gordon L. Burditt

        Comment

        • Ian.H

          #5
          Re: PHP not seeing Mysql.

          On Wed, 04 Aug 2004 17:50:41 -0400, David Scribler wrote:
          [color=blue][color=green][color=darkred]
          >>>"Fatal error: Call to undefined function: mysql_connect() in
          >>>/home/david/html/html/test.php on line 3"
          >>>
          >>>I am using Debian unstable. Is there some setting I need to look at in
          >>>the php.ini file?[/color]
          >>
          >>
          >>
          >> Did you compile PHP with mysql enabled?[/color][/color]
          [color=blue][color=green]
          >>[/color]
          > I did an apt-get on mysql. Since mysql is a default I would asume that
          > it was compiled in. I could be wrong.[/color]


          No idea about Linux.. but my BSD installs went like:


          [ SQL ]
          - install MySQL


          [ PHP ]
          - ./configure --lotsa=stuff --with-mysql=/usr/local
          - install


          The only chance you'd have the way you have it is if there's a build
          option with your package system, for example, FreeBSD ports I can do with
          some things:


          # cd /usr/ports/foo/bar
          # make PREFIX=/usr install


          Whether you have this option with your PHP package where you could specify
          'WITH_MYSQL=yes ' or similar, the pkg _might_ automagically download and
          configure MySQL then much like a dependency might be.

          I've never used a Linux box so no idea how those pkgs work, but might be
          something to look for, but I'd suspect install MySQL first, _then_
          maybe the option with the PHP install... man pages maybe more help =)



          Regards,

          Ian

          --
          Ian.H
          digiServ Network
          London, UK


          Comment

          • marathon

            #6
            Re: PHP not seeing Mysql.

            On Wed, 04 Aug 2004 17:50:41 -0400, David Scribler in comp.lang.php wrote:[color=blue]
            >Ian.H wrote:[/color]
            [color=blue][color=green]
            >> Did you compile PHP with mysql enabled?
            >>
            >>
            >>
            >> Regards,
            >>
            >> Ian
            >>[/color]
            >I did an apt-get on mysql. Since mysql is a default I would asume that
            >it was compiled in. I could be wrong.[/color]

            On Debian (Sarge), one needs the 'php4-mysql' package installed in order
            for php to work with mysql. I'm sure testing is similiar.

            Any easy way to check (if you have aptitude installed) is thus;

            'aptitude search php|less' see if the 'i' symbol is beside the
            'php4-mysql' package. If not installing it should fix things up.

            --
            ATTENTION
            This room is fullfilled mit special electronische equippment.
            Fingergrabbing and pressing the cnoeppkes from the computers is
            allowed for die experts only! So all the "lefthander s" stay away
            and do not disturben the brainstorming von here working
            intelligencies. Otherwise you will be out thrown and kicked
            anderswhere! Also: please keep still and only watchen
            astaunished the blinkenlights.

            Comment

            • David Scribler

              #7
              Re: PHP not seeing Mysql.

              marathon wrote:[color=blue]
              > On Wed, 04 Aug 2004 17:50:41 -0400, David Scribler in comp.lang.php wrote:
              >[color=green]
              >>Ian.H wrote:[/color]
              >
              >[color=green][color=darkred]
              >>>Did you compile PHP with mysql enabled?
              >>>
              >>>
              >>>
              >>>Regards,
              >>>
              >>> Ian
              >>>[/color]
              >>
              >>I did an apt-get on mysql. Since mysql is a default I would asume that
              >>it was compiled in. I could be wrong.[/color]
              >
              >
              > On Debian (Sarge), one needs the 'php4-mysql' package installed in order
              > for php to work with mysql. I'm sure testing is similiar.
              >
              > Any easy way to check (if you have aptitude installed) is thus;
              >
              > 'aptitude search php|less' see if the 'i' symbol is beside the
              > 'php4-mysql' package. If not installing it should fix things up.
              >[/color]
              Thanks I just ran apt-get on that package restarted php and it seems to
              be working. Thanks

              Comment

              Working...