Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • das dsf

    Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20


    Hi there!

    I have both PHP 4.0( RPM) installed and MySQL 4.0.20 installed with the
    mysqld daemon up and running. But when I look at the output of phpinfo() ,
    I do not see it there, which is worrisome and so I tried to recompile PHP
    and do ./configure with the --with-mysql=path but I don't really know
    where my mysql's header files should be , is there any way to find that
    out by using any of the mysql commands?

    I did try to do ./configure for PHP4 without any parameters and when I
    looked at the output, I do see that PHP seems to recognize that mySQL is
    there :

    ....
    checking for MSSQL support via FreeTDS... no
    checking for MySQL support... yes
    checking for specified location of the MySQL UNIX socket... no
    checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
    checking for inline... (cached) inline
    .....

    Hence, why is that when I do phpinfo() , mySQL still doesn't show up?

    I suspect that mysql isn't working correctly with php, because if I use
    the mysql_connect() function in my php, I get the error "Fatal error: Call
    to undefined function: mysql_connect() "
    and yet it DOES seem like PHP recognizes mysql is there.

    That "unable to recognize mysql_connect function" error comes up after
    installing PHP using ./configure with or without any parameters.

    Please help, thanks. I am pretty sure my MySQL is properly installed
    because I can mysql into the server and set up my database

    ##-----------------------------------------------#
    Article posted from PHP Freaks NewsGroup

    Get Addicted: comp.lang.ph
    ##-----------------------------------------------##
  • Pedro Graca

    #2
    Re: Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20

    das dsf wrote:[color=blue]
    > Hence, why is that when I do phpinfo() , mySQL still doesn't show up?[/color]
    (snip)[color=blue]
    > Please help, thanks. I am pretty sure my MySQL is properly installed
    > because I can mysql into the server and set up my database[/color]

    Have you uncommented the line

    ;extension=mysq l.so

    in php.ini?


    --
    USENET would be a better place if everybody read: | to email me: use |
    http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
    http://www.netmeister.org/news/learn2quote2.html | header, textonly |
    http://www.expita.com/nomime.html | no attachments. |

    Comment

    • John

      #3
      Re: Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20

      I did not see a line called extension=mysql .so , but I did see a commented
      out line for extension=msql. so . Should I uncomment and rename it mysql.so
      ?

      Moreover, I only found a php.ini-recommended file which is what I was
      referring to from above.

      "Pedro Graca" <hexkid@hotpop. com> wrote in message
      news:slrnce98d2 .tjn.hexkid@ID-203069.user.uni-berlin.de...[color=blue]
      > das dsf wrote:[color=green]
      > > Hence, why is that when I do phpinfo() , mySQL still doesn't show up?[/color]
      > (snip)[color=green]
      > > Please help, thanks. I am pretty sure my MySQL is properly installed
      > > because I can mysql into the server and set up my database[/color]
      >
      > Have you uncommented the line
      >
      > ;extension=mysq l.so
      >
      > in php.ini?
      >
      >
      > --
      > USENET would be a better place if everybody read: | to email me: use |
      > http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
      > http://www.netmeister.org/news/learn2quote2.html | header, textonly |
      > http://www.expita.com/nomime.html | no attachments. |[/color]


      Comment

      • Pedro Graca

        #4
        Re: Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20

        John top-posted [corrected]:[color=blue]
        > "Pedro Graca" <hexkid@hotpop. com> wrote in message
        > news:slrnce98d2 .tjn.hexkid@ID-203069.user.uni-berlin.de...[color=green]
        >> das dsf wrote:[color=darkred]
        >> > Hence, why is that when I do phpinfo() , mySQL still doesn't show up?[/color]
        >> (snip)[color=darkred]
        >> > Please help, thanks. I am pretty sure my MySQL is properly installed
        >> > because I can mysql into the server and set up my database[/color]
        >>
        >> Have you uncommented the line
        >>
        >> ;extension=mysq l.so
        >>
        >> in php.ini?[/color]
        >
        > I did not see a line called extension=mysql .so , but I did see a commented
        > out line for extension=msql. so . Should I uncomment and rename it mysql.so
        > ?[/color]

        Try it :)
        [color=blue]
        > Moreover, I only found a php.ini-recommended file which is what I was
        > referring to from above.[/color]

        The output of phpinfo() should tell you what php.ini your PHP is using.
        So, find that file and make sure it has a line that enables MySQL.

        --
        USENET would be a better place if everybody read: | to email me: use |
        http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
        http://www.netmeister.org/news/learn2quote2.html | header, textonly |
        http://www.expita.com/nomime.html | no attachments. |

        Comment

        • Gary L. Burnore

          #5
          Re: Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20

          On 2 Jul 2004 09:22:31 GMT, Pedro Graca <hexkid@hotpop. com> wrote:
          [color=blue]
          >John top-posted [corrected]:[color=green]
          >> "Pedro Graca" <hexkid@hotpop. com> wrote in message
          >> news:slrnce98d2 .tjn.hexkid@ID-203069.user.uni-berlin.de...[color=darkred]
          >>> das dsf wrote:
          >>> > Hence, why is that when I do phpinfo() , mySQL still doesn't show up?
          >>> (snip)
          >>> > Please help, thanks. I am pretty sure my MySQL is properly installed
          >>> > because I can mysql into the server and set up my database
          >>>
          >>> Have you uncommented the line
          >>>
          >>> ;extension=mysq l.so
          >>>
          >>> in php.ini?[/color]
          >>
          >> I did not see a line called extension=mysql .so , but I did see a commented
          >> out line for extension=msql. so . Should I uncomment and rename it mysql.so
          >> ?[/color]
          >
          >Try it :)[/color]

          No, don't try it. MSQL and Mysql are different databases. Not at all
          compatable.
          [color=blue]
          >[color=green]
          >> Moreover, I only found a php.ini-recommended file which is what I was
          >> referring to from above.[/color]
          >
          >The output of phpinfo() should tell you what php.ini your PHP is using.
          >So, find that file and make sure it has a line that enables MySQL.[/color]

          Or compile php with the --with-mysql=/path/to/mysql set correctly.



          --
          gburnore@databa six dot com
          ---------------------------------------------------------------------------
          How you look depends on where you go.
          ---------------------------------------------------------------------------
          Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
          | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
          DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
          | ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
          Black Helicopter Repair Svcs Division | Official Proof of Purchase
          =============== =============== =============== =============== ===============
          Want one? GET one! http://www.databasix.com
          =============== =============== =============== =============== ===============

          Comment

          • Pedro Graca

            #6
            Re: Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20

            Gary L Burnore wrote:[color=blue]
            > On 2 Jul 2004 09:22:31 GMT, Pedro Graca <hexkid@hotpop. com> wrote:
            >[color=green]
            >>John top-posted [corrected]:[color=darkred]
            >>> I did not see a line called extension=mysql .so , but I did see a commented
            >>> out line for extension=msql. so . Should I uncomment and rename it mysql.so[/color][/color][/color]
            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ^^^^^^^^

            [color=blue][color=green]
            >>
            >>Try it :)[/color]
            >
            > No, don't try it. MSQL and Mysql are different databases. Not at all
            > compatable.[/color]



            --
            USENET would be a better place if everybody read: | to email me: use |
            http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
            http://www.netmeister.org/news/learn2quote2.html | header, textonly |
            http://www.expita.com/nomime.html | no attachments. |

            Comment

            • Jay Donnell

              #7
              Re: Problem getting PHP to recognize MySQL, Using PHP 4.3.7 and MySQL 4.0.20

              What distro are you using? I know I've had many hard times getting php
              and mysql to play nice on redhat/fedora systems when using RPM's that
              weren't fromt the distro (i.e. the RPM from mysql.com). The problem
              was that the php rpm expected an older version of the mysql.so (I
              think it was mysql.so.10 or maybe 11) and MySQL 4 and higher used a
              newer version. That might be something to look into.

              Comment

              Working...